diff options
| author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2016-08-04 11:29:59 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-08-05 17:41:49 -0400 |
| commit | bfd8f16fbdae1aeaa4d5076721238c041d582e82 (patch) | |
| tree | 4560cab5dff4b16ddf23963cefbdc9dbeaf8c177 | |
| parent | 0d82389adf7ac9f4ded571b5ab483444ef475c64 (diff) | |
[1.10.x] Edited docs of test.utils.setup/teardown_test_environment().
Backport of 42f9d65107692528583786a0695e26e2cbfc51a0 from master
| -rw-r--r-- | django/test/utils.py | 15 | ||||
| -rw-r--r-- | docs/topics/testing/advanced.txt | 10 |
2 files changed, 10 insertions, 15 deletions
diff --git a/django/test/utils.py b/django/test/utils.py index e0b2b0da6c..3bd0f7f353 100644 --- a/django/test/utils.py +++ b/django/test/utils.py @@ -95,11 +95,9 @@ def instrumented_test_render(self, context): def setup_test_environment(): - """Perform any global pre-test setup. This involves: - - - Installing the instrumented test renderer - - Set the email backend to the locmem email backend. - - Setting the active locale to match the LANGUAGE_CODE setting. + """ + Perform global pre-test setup, such as installing the instrumented template + renderer and setting the email backend to the locmem email backend. """ Template._original_render = Template._render Template._render = instrumented_test_render @@ -119,10 +117,9 @@ def setup_test_environment(): def teardown_test_environment(): - """Perform any global post-test teardown. This involves: - - - Restoring the original test renderer - - Restoring the email sending functions + """ + Perform any global post-test teardown, such as restoring the original + template renderer and restoring the email sending functions. """ Template._render = Template._original_render del Template._original_render diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt index 754904e1d0..dacf858db2 100644 --- a/docs/topics/testing/advanced.txt +++ b/docs/topics/testing/advanced.txt @@ -545,15 +545,13 @@ utility methods in the ``django.test.utils`` module. .. function:: setup_test_environment() - Performs any global pre-test setup, such as the installing the - instrumentation of the template rendering system and setting up - the dummy email outbox. + Performs global pre-test setup, such as installing instrumentation for the + template rendering system and setting up the dummy email outbox. .. function:: teardown_test_environment() - Performs any global post-test teardown, such as removing the black - magic hooks into the template system and restoring normal email - services. + Performs global post-test teardown, such as removing instrumentation from + the template system and restoring normal email services. ``django.db.connection.creation`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
