diff options
| author | Tim Graham <timograham@gmail.com> | 2016-05-09 13:13:55 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-05-17 07:22:26 -0400 |
| commit | ece4d24f8e494129c098868fa792400937941fab (patch) | |
| tree | f5f2b3211ffae49375c5e7390f4ed25e07110b3b /tests/auth_tests | |
| parent | 9baf692a58de78dba13aa582098781675367c329 (diff) | |
Refs #26601 -- Deprecated old-style middleware.
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_context_processors.py | 4 | ||||
| -rw-r--r-- | tests/auth_tests/test_remote_user.py | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/auth_tests/test_context_processors.py b/tests/auth_tests/test_context_processors.py index d1db63c7b2..150703440b 100644 --- a/tests/auth_tests/test_context_processors.py +++ b/tests/auth_tests/test_context_processors.py @@ -4,6 +4,8 @@ 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 @@ -76,6 +78,7 @@ 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/') @@ -90,6 +93,7 @@ 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/') diff --git a/tests/auth_tests/test_remote_user.py b/tests/auth_tests/test_remote_user.py index 1cb7666a49..2b5bf32d74 100644 --- a/tests/auth_tests/test_remote_user.py +++ b/tests/auth_tests/test_remote_user.py @@ -6,7 +6,9 @@ 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') @@ -151,6 +153,7 @@ class RemoteUserTest(TestCase): self.assertTrue(response.context['user'].is_anonymous) +@ignore_warnings(category=RemovedInDjango20Warning) @override_settings(MIDDLEWARE=None) class RemoteUserTestMiddlewareClasses(RemoteUserTest): |
