mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #26601 -- Deprecated old-style middleware.
This commit is contained in:
@@ -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/')
|
||||
|
||||
Reference in New Issue
Block a user