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.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.setup_test_environment()

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

test.Response.wsgi_request

wsgi_request The WSGIRequest instance generated by the test handler that generated the response.

test.runner.DiscoverRunner.run_tests()

DiscoverRunner.run_tests(test_labels, extra_tests=None, **kwargs) Run the test suite. test_labels allows you to specify which tests to run and supports several formats (see DiscoverRunner.build_suite() for a list of supported formats). extra_tests is a list of extra TestCase instances to add to the suite that is executed by the test runner. These extra tests are run in addition to those discovered in the modules listed in test_labels. This method should return the number of tests that failed

test.runner.DiscoverRunner

class DiscoverRunner(pattern='test*.py', top_level=None, verbosity=1, interactive=True, failfast=False, keepdb=False, reverse=False, debug_sql=False, **kwargs) DiscoverRunner will search for tests in any file matching pattern. top_level can be used to specify the directory containing your top-level Python modules. Usually Django can figure this out automatically, so it’s not necessary to specify this option. If specified, it should generally be the directory containing your manage.py file. v

test.runner.DiscoverRunner.run_suite()

DiscoverRunner.run_suite(suite, **kwargs) Runs the test suite. Returns the result produced by the running the test suite.

test.runner.DiscoverRunner.build_suite()

DiscoverRunner.build_suite(test_labels, extra_tests=None, **kwargs) Constructs a test suite that matches the test labels provided. test_labels is a list of strings describing the tests to be run. A test label can take one of four forms: path.to.test_module.TestCase.test_method – Run a single test method in a test case. path.to.test_module.TestCase – Run all the test methods in a test case. path.to.module – Search for and run all tests in the named Python package or module. path/to/direct

test.Response.request

request The request data that stimulated the response.