test.runner.DiscoverRunner.setup_databases()

DiscoverRunner.setup_databases(**kwargs) Creates the test databases. Returns a data structure that provides enough detail to undo the changes that have been made. This data will be provided to the teardown_databases() function at the conclusion of testing.

test.runner.DiscoverRunner.setup_test_environment()

DiscoverRunner.setup_test_environment(**kwargs) Sets up the test environment by calling setup_test_environment() and setting DEBUG to False.

test.runner.DiscoverRunner.suite_result()

DiscoverRunner.suite_result(suite, result, **kwargs) Computes and returns a return code based on a test suite, and the result from that test suite.

test.runner.DiscoverRunner.teardown_databases()

DiscoverRunner.teardown_databases(old_config, **kwargs) Destroys the test databases, restoring pre-test conditions. old_config is a data structure defining the changes in the database configuration that need to be reversed. It is the return value of the setup_databases() method.

test.runner.DiscoverRunner.teardown_test_environment()

DiscoverRunner.teardown_test_environment(**kwargs) Restores the pre-test environment.

test.runner.DiscoverRunner.test_loader

DiscoverRunner.test_loader This is the class that loads tests, whether from TestCases or modules or otherwise and bundles them into test suites for the runner to execute. By default it is set to unittest.defaultTestLoader. You can override this attribute if your tests are going to be loaded in unusual ways.

test.runner.DiscoverRunner.test_runner

DiscoverRunner.test_runner This is the class of the low-level test runner which is used to execute the individual tests and format the results. By default it is set to unittest.TextTestRunner. Despite the unfortunate similarity in naming conventions, this is not the same type of class as DiscoverRunner, which covers a broader set of responsibilities. You can override this attribute to modify the way tests are run and reported.

test.runner.DiscoverRunner.test_suite

DiscoverRunner.test_suite The class used to build the test suite. By default it is set to unittest.TestSuite. This can be overridden if you wish to implement different logic for collecting tests.

test.SimpleTestCase

class SimpleTestCase [source] A subclass of unittest.TestCase that adds this functionality: Some useful assertions like:Checking that a callable raises a certain exception. Testing form field rendering and error treatment. Testing HTML responses for the presence/lack of a given fragment. Verifying that a template has/hasn't been used to generate a given response content. Verifying a HTTP redirect is performed by the app. Robustly testing two HTML fragments for equality/inequality or containm

test.SimpleTestCase.allow_database_queries

SimpleTestCase.allow_database_queries New in Django 1.9. SimpleTestCase disallows database queries by default. This helps to avoid executing write queries which will affect other tests since each SimpleTestCase test isn’t run in a transaction. If you aren’t concerned about this problem, you can disable this behavior by setting the allow_database_queries class attribute to True on your test class. Warning SimpleTestCase and its subclasses (e.g. TestCase, ...) rely on setUpClass() and tearD