summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJake Howard <git@theorangeone.net>2025-11-24 15:30:23 -0300
committerNatalia <124304+nessita@users.noreply.github.com>2025-11-24 16:40:23 -0300
commite0f3e3ec9460bd57d90fbe9d86bb920b3de03f14 (patch)
treed3ddd281d443ee3a0ce82f6c1658b303a95526a3 /tests
parentabce62994620956c3c9cce6edcebf8fcfb2670d4 (diff)
[6.0.x] Corrected assertions for True/False results in tests/auth_tests/test_handlers.py.
Backport of d08ae991a83950aba5043f5a34f5af12d2effe9e from main.
Diffstat (limited to 'tests')
-rw-r--r--tests/auth_tests/test_handlers.py14
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):
"""