test

test.runner

Tests runners for Django projects with djangoes.

When using the built-in Django admin test command, the simplest way to integrate djangoes is to configure the TEST_RUNNER settings, using the runner provided by djangoes:

TEST_RUNNER = 'djangoes.test.runner.DiscoverRunner'
class DiscoverRunner(pattern=None, top_level=None, verbosity=1, interactive=True, failfast=False, **kwargs)

Unittest Runner with Django and ElasticSearch.

Setup ElasticSearch connections in order to run tests with the test settings and not the developement/production settings.

When using djangoes in a Django project, it requires to define the settings option TEST_RUNNER to djangoes.test.runner.DiscoverRunner to allow the tests with djangoes and ElasticSearch to work properly.

test.testcases

TestCase classes for ElasticSearch in Django.

These classes combine Django test case classes with djangoes mixin in order to replace them in a Django project with ElasticSearch.

Instead of doing:

from django.test.testcases import SimpleTestCase

One can do:

from djangoes.test.testcases import SimpleTestCase

It works the same way for TransactionTestCase and TestCase.

class SimpleTestCase(methodName='runTest')

Simple test case with Django and ElasticSearch.

Automatically create the indices for all configured ElasticSearch connections, combined with the setup & tear down of the Django SimpleTestCase test case class.

class TestCase(methodName='runTest')

Test case with Django and ElasticSearch.

Automatically create the indices for all configured ElasticSearch connections, combined with the setup & tear down of the Django TestCase test case class.

class TransactionTestCase(methodName='runTest')

Transaction test case with Django and ElasticSearch.

Automatically create the indices for all configured ElasticSearch connections, combined with the setup & tear down of the Django TransactionTestCase test case class.

test.utils

Utility functions for testing purpose with djangoes.

setup_djangoes()

Setup ElasticSearch connections with djangoes for testing purpose.

When testing with ElasticSearch, used indices must not be the same as the one used for live settings, ie. tests must use the TEST settings.

This function takes care of replacing each used index name by its appropriate test name.