diff options
| author | Jake Howard <git@theorangeone.net> | 2025-11-24 15:30:23 -0300 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2025-11-24 16:39:27 -0300 |
| commit | d08ae991a83950aba5043f5a34f5af12d2effe9e (patch) | |
| tree | f5b06b7b855447058df1278178cd97b22dd9226b /tests/auth_tests | |
| parent | 2a6e0bd72d4a69725b957d6748a4b834f21b12b5 (diff) | |
Corrected assertions for True/False results in tests/auth_tests/test_handlers.py.
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_handlers.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auth_tests/test_handlers.py b/tests/auth_tests/test_handlers.py index a6b53a9ef1..77f37db009 100644 --- a/tests/auth_tests/test_handlers.py +++ b/tests/auth_tests/test_handlers.py @@ -29,14 +29,14 @@ class ModWsgiHandlerTestCase(TransactionTestCase): self.assertIsNone(check_password({}, "unknown", "")) # Valid user with correct password - self.assertTrue(check_password({}, "test", "test")) + self.assertIs(check_password({}, "test", "test"), True) + + # Valid user with incorrect password + self.assertIs(check_password({}, "test", "incorrect"), False) # correct password, but user is inactive User.objects.filter(username="test").update(is_active=False) - self.assertFalse(check_password({}, "test", "test")) - - # Valid user with incorrect password - self.assertFalse(check_password({}, "test", "incorrect")) + self.assertIsNone(check_password({}, "test", "test")) @override_settings(AUTH_USER_MODEL="auth_tests.CustomUser") def test_check_password_custom_user(self): @@ -53,10 +53,10 @@ class ModWsgiHandlerTestCase(TransactionTestCase): self.assertIsNone(check_password({}, "unknown", "")) # Valid user with correct password' - self.assertTrue(check_password({}, "test@example.com", "test")) + self.assertIs(check_password({}, "test@example.com", "test"), True) # Valid user with incorrect password - self.assertFalse(check_password({}, "test@example.com", "incorrect")) + self.assertIs(check_password({}, "test@example.com", "incorrect"), False) def test_groups_for_user(self): """ |
