1
0
mirror of https://github.com/django/django.git synced 2025-10-29 00:26:07 +00:00

Used addCleanup() in tests where appropriate.

This commit is contained in:
Mariusz Felisiak
2023-12-31 10:01:31 +01:00
committed by GitHub
parent 81ccf92f15
commit d88ec42bd0
37 changed files with 121 additions and 240 deletions

View File

@@ -21,14 +21,12 @@ class RemoteUserTest(TestCase):
known_user2 = "knownuser2"
def setUp(self):
self.patched_settings = modify_settings(
patched_settings = modify_settings(
AUTHENTICATION_BACKENDS={"append": self.backend},
MIDDLEWARE={"append": self.middleware},
)
self.patched_settings.enable()
def tearDown(self):
self.patched_settings.disable()
patched_settings.enable()
self.addCleanup(patched_settings.disable)
def test_no_remote_user(self):
"""Users are not created when remote user is not specified."""