diff options
| author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2016-08-08 02:38:10 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-08-08 10:40:29 -0400 |
| commit | e7fb724cd2928802fbefa3b5491640fab51e898a (patch) | |
| tree | 27613017be54bd10fce376a84c97ed6478929c62 /tests | |
| parent | a7863c78b7f3619a8d3d27e67c7284a349058c08 (diff) | |
Fixed #27032 -- Prevented setup_test_environment() from being called twice.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_utils/tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 395884fedf..16c4890914 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -20,6 +20,7 @@ from django.test import ( from django.test.html import HTMLParseError, parse_html from django.test.utils import ( CaptureQueriesContext, isolate_apps, override_settings, + setup_test_environment, ) from django.urls import NoReverseMatch, reverse from django.utils import six @@ -864,6 +865,13 @@ class SecondUrls: urlpatterns = [url(r'second/$', empty_response, name='second')] +class SetupTestEnvironmentTests(SimpleTestCase): + + def test_setup_test_environment_calling_more_than_once(self): + with self.assertRaisesMessage(RuntimeError, "setup_test_environment() was already called"): + setup_test_environment() + + class OverrideSettingsTests(SimpleTestCase): # #21518 -- If neither override_settings nor a setting_changed receiver |
