mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Used enterClassContext() where appropriate.
This commit is contained in:
@@ -20,13 +20,15 @@ class RemoteUserTest(TestCase):
|
||||
known_user = "knownuser"
|
||||
known_user2 = "knownuser2"
|
||||
|
||||
def setUp(self):
|
||||
patched_settings = modify_settings(
|
||||
AUTHENTICATION_BACKENDS={"append": self.backend},
|
||||
MIDDLEWARE={"append": self.middleware},
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.enterClassContext(
|
||||
modify_settings(
|
||||
AUTHENTICATION_BACKENDS={"append": cls.backend},
|
||||
MIDDLEWARE={"append": cls.middleware},
|
||||
)
|
||||
)
|
||||
patched_settings.enable()
|
||||
self.addCleanup(patched_settings.disable)
|
||||
super().setUpClass()
|
||||
|
||||
def test_no_remote_user(self):
|
||||
"""Users are not created when remote user is not specified."""
|
||||
|
||||
Reference in New Issue
Block a user