summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-05-26 20:58:41 -0400
committerTim Graham <timograham@gmail.com>2018-05-26 21:07:19 -0400
commit483f5d6c4f66c8dfca5770de7b1af8aea05a5e7c (patch)
treeb3bffa86aa0fd8c906f4fd490a9b77ce32a27c89 /tests
parent39e61669e0c4299228dca751852002946ebe5d5e (diff)
[2.1.x] Reverted "Fixed #29324 -- Made Settings raise ImproperlyConfigured if SECRET_KEY is accessed and not set."
This reverts commit b3cffde5559c4fa97625512d7ec41a674be26076 due to a regression and performance concerns. Backport of 5cc81cd9eb69f5f7a711412c02039b435c393135 from master
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_scripts/tests.py13
-rw-r--r--tests/settings_tests/tests.py14
2 files changed, 3 insertions, 24 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 17347a476b..3c4e01dfac 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -2213,11 +2213,7 @@ class DiffSettings(AdminScriptTestCase):
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "+ FOO = 'bar'")
- self.assertOutput(out, "- INSTALLED_APPS = []")
- self.assertOutput(
- out,
- "+ INSTALLED_APPS = ['django.contrib.auth', 'django.contrib.contenttypes', 'admin_scripts']"
- )
+ self.assertOutput(out, "- SECRET_KEY = ''")
self.assertOutput(out, "+ SECRET_KEY = 'django_tests_secret_key'")
self.assertNotInOutput(out, " APPEND_SLASH = True")
@@ -2233,12 +2229,7 @@ class DiffSettings(AdminScriptTestCase):
self.assertNoOutput(err)
self.assertOutput(out, " APPEND_SLASH = True")
self.assertOutput(out, "+ FOO = 'bar'")
- self.assertOutput(out, "- INSTALLED_APPS = []")
- self.assertOutput(
- out,
- "+ INSTALLED_APPS = ['django.contrib.auth', 'django.contrib.contenttypes', 'admin_scripts']"
- )
- self.assertOutput(out, "+ SECRET_KEY = 'django_tests_secret_key'")
+ self.assertOutput(out, "- SECRET_KEY = ''")
class Dumpdata(AdminScriptTestCase):
diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py
index 53a9ea98f6..383345494d 100644
--- a/tests/settings_tests/tests.py
+++ b/tests/settings_tests/tests.py
@@ -291,20 +291,8 @@ class SettingsTests(SimpleTestCase):
def test_no_secret_key(self):
settings_module = ModuleType('fake_settings_module')
sys.modules['fake_settings_module'] = settings_module
- msg = 'The SECRET_KEY setting must be set.'
+ msg = 'The SECRET_KEY setting must not be empty.'
try:
- settings = Settings('fake_settings_module')
- with self.assertRaisesMessage(ImproperlyConfigured, msg):
- settings.SECRET_KEY
- finally:
- del sys.modules['fake_settings_module']
-
- def test_secret_key_empty_string(self):
- settings_module = ModuleType('fake_settings_module')
- settings_module.SECRET_KEY = ''
- sys.modules['fake_settings_module'] = settings_module
- try:
- msg = 'The SECRET_KEY setting must not be empty.'
with self.assertRaisesMessage(ImproperlyConfigured, msg):
Settings('fake_settings_module')
finally: