diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-12-31 10:01:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-31 10:01:31 +0100 |
| commit | d88ec42bd0a37340c8477a6f20bf26e58bd84735 (patch) | |
| tree | abd9422f7fb34a19579a74515ce84d9f472cd226 /tests/auth_tests/test_remote_user.py | |
| parent | 81ccf92f154c6d9eac3e30bac0aa67574d0ace15 (diff) | |
Used addCleanup() in tests where appropriate.
Diffstat (limited to 'tests/auth_tests/test_remote_user.py')
| -rw-r--r-- | tests/auth_tests/test_remote_user.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/auth_tests/test_remote_user.py b/tests/auth_tests/test_remote_user.py index ea4399a44a..6066ab96e9 100644 --- a/tests/auth_tests/test_remote_user.py +++ b/tests/auth_tests/test_remote_user.py @@ -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.""" |
