mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Refs #32508 -- Raised ImproperlyConfigured instead of using "assert" in middlewares.
This commit is contained in:
committed by
Mariusz Felisiak
parent
dc86a25a67
commit
a2d5ea626e
@@ -1,5 +1,6 @@
|
||||
from django.contrib.auth.middleware import AuthenticationMiddleware
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.test import TestCase
|
||||
|
||||
@@ -38,5 +39,5 @@ class TestAuthenticationMiddleware(TestCase):
|
||||
"'django.contrib.sessions.middleware.SessionMiddleware' before "
|
||||
"'django.contrib.auth.middleware.AuthenticationMiddleware'."
|
||||
)
|
||||
with self.assertRaisesMessage(AssertionError, msg):
|
||||
with self.assertRaisesMessage(ImproperlyConfigured, msg):
|
||||
self.middleware(HttpRequest())
|
||||
|
||||
Reference in New Issue
Block a user