diff options
| author | Tim Graham <timograham@gmail.com> | 2016-12-31 13:24:00 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-17 20:52:04 -0500 |
| commit | d334f46b7a080fd3eb720141c19b37b10704a352 (patch) | |
| tree | eeea5a2a967c3078a58455b71cfa64dc8ead2fc6 /tests/auth_tests | |
| parent | 631f4ab06112aca5bd6a57b81159048f936050bf (diff) | |
Refs #26601 -- Removed support for old-style middleware using settings.MIDDLEWARE_CLASSES.
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_context_processors.py | 14 | ||||
| -rw-r--r-- | tests/auth_tests/test_remote_user.py | 18 |
2 files changed, 0 insertions, 32 deletions
diff --git a/tests/auth_tests/test_context_processors.py b/tests/auth_tests/test_context_processors.py index d9efdc3d5b..3857917860 100644 --- a/tests/auth_tests/test_context_processors.py +++ b/tests/auth_tests/test_context_processors.py @@ -4,8 +4,6 @@ from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.db.models import Q from django.test import SimpleTestCase, TestCase, override_settings -from django.test.utils import ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning from .settings import AUTH_MIDDLEWARE, AUTH_TEMPLATES @@ -78,12 +76,6 @@ class AuthContextProcessorTests(TestCase): response = self.client.get('/auth_processor_no_attr_access/') self.assertContains(response, "Session not accessed") - @ignore_warnings(category=RemovedInDjango20Warning) - @override_settings(MIDDLEWARE_CLASSES=AUTH_MIDDLEWARE, MIDDLEWARE=None) - def test_session_not_accessed_middleware_classes(self): - response = self.client.get('/auth_processor_no_attr_access/') - self.assertContains(response, "Session not accessed") - @override_settings(MIDDLEWARE=AUTH_MIDDLEWARE) def test_session_is_accessed(self): """ @@ -93,12 +85,6 @@ class AuthContextProcessorTests(TestCase): response = self.client.get('/auth_processor_attr_access/') self.assertContains(response, "Session accessed") - @ignore_warnings(category=RemovedInDjango20Warning) - @override_settings(MIDDLEWARE_CLASSES=AUTH_MIDDLEWARE, MIDDLEWARE=None) - def test_session_is_accessed_middleware_classes(self): - response = self.client.get('/auth_processor_attr_access/') - self.assertContains(response, "Session accessed") - def test_perms_attrs(self): u = User.objects.create_user(username='normal', password='secret') u.user_permissions.add( diff --git a/tests/auth_tests/test_remote_user.py b/tests/auth_tests/test_remote_user.py index 05c76ff6e3..e03e0a3b95 100644 --- a/tests/auth_tests/test_remote_user.py +++ b/tests/auth_tests/test_remote_user.py @@ -6,9 +6,7 @@ from django.contrib.auth.backends import RemoteUserBackend from django.contrib.auth.middleware import RemoteUserMiddleware from django.contrib.auth.models import User from django.test import TestCase, modify_settings, override_settings -from django.test.utils import ignore_warnings from django.utils import timezone -from django.utils.deprecation import RemovedInDjango20Warning @override_settings(ROOT_URLCONF='auth_tests.urls') @@ -153,22 +151,6 @@ class RemoteUserTest(TestCase): self.assertTrue(response.context['user'].is_anonymous) -@ignore_warnings(category=RemovedInDjango20Warning) -@override_settings(MIDDLEWARE=None) -class RemoteUserTestMiddlewareClasses(RemoteUserTest): - - def setUp(self): - self.patched_settings = modify_settings( - AUTHENTICATION_BACKENDS={'append': self.backend}, - MIDDLEWARE_CLASSES={'append': [ - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - self.middleware, - ]}, - ) - self.patched_settings.enable() - - class RemoteUserNoCreateBackend(RemoteUserBackend): """Backend that doesn't create unknown users.""" create_unknown_user = False |
