diff options
author | Tim Graham <timograham@gmail.com> | 2015-09-02 20:50:34 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-09-23 19:31:10 -0400 |
commit | 849037af36000d53b0b3b52f780ff475534e195b (patch) | |
tree | f14248a2f5296cd0c3c1eeb0297df80388cc1f7f /tests/settings_tests | |
parent | 5d383549eee498e4903fe290613d726a68615aca (diff) | |
download | django-849037af36000d53b0b3b52f780ff475534e195b.tar.gz |
Refs #23957 -- Required session verification per deprecation timeline.
Diffstat (limited to 'tests/settings_tests')
-rw-r--r-- | tests/settings_tests/tests.py | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py index 90b2b8e580..bf4f071c2f 100644 --- a/tests/settings_tests/tests.py +++ b/tests/settings_tests/tests.py @@ -12,7 +12,6 @@ from django.test import ( override_settings, signals, ) from django.utils import six -from django.utils.encoding import force_text @modify_settings(ITEMS={ @@ -489,47 +488,3 @@ class TestListSettings(unittest.TestCase): finally: del sys.modules['fake_settings_module'] delattr(settings_module, setting) - - -class TestSessionVerification(unittest.TestCase): - - def setUp(self): - self.settings_module = ModuleType('fake_settings_module') - self.settings_module.SECRET_KEY = 'foo' - - def tearDown(self): - if 'fake_settings_module' in sys.modules: - del sys.modules['fake_settings_module'] - - def test_session_verification_deprecation_no_verification(self): - self.settings_module.MIDDLEWARE_CLASSES = ['django.contrib.auth.middleware.AuthenticationMiddleware'] - sys.modules['fake_settings_module'] = self.settings_module - with warnings.catch_warnings(record=True) as warn: - warnings.filterwarnings('always') - Settings('fake_settings_module') - self.assertEqual( - force_text(warn[0].message), - "Session verification will become mandatory in Django 1.10. " - "Please add 'django.contrib.auth.middleware.SessionAuthenticationMiddleware' " - "to your MIDDLEWARE_CLASSES setting when you are ready to opt-in after " - "reading the upgrade considerations in the 1.8 release notes.", - ) - - def test_session_verification_deprecation_both(self): - self.settings_module.MIDDLEWARE_CLASSES = [ - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', - ] - sys.modules['fake_settings_module'] = self.settings_module - with warnings.catch_warnings(record=True) as warn: - warnings.filterwarnings('always') - Settings('fake_settings_module') - self.assertEqual(len(warn), 0) - - def test_session_verification_deprecation_neither(self): - self.settings_module.MIDDLEWARE_CLASSES = [] - sys.modules['fake_settings_module'] = self.settings_module - with warnings.catch_warnings(record=True) as warn: - warnings.filterwarnings('always') - Settings('fake_settings_module') - self.assertEqual(len(warn), 0) |