From e0f3e3ec9460bd57d90fbe9d86bb920b3de03f14 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 24 Nov 2025 15:30:23 -0300 Subject: [6.0.x] Corrected assertions for True/False results in tests/auth_tests/test_handlers.py. Backport of d08ae991a83950aba5043f5a34f5af12d2effe9e from main. --- tests/auth_tests/test_handlers.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') 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): """ -- cgit v1.3