diff --git a/tests/test_auth.py b/tests/test_auth.py index fde90d7d..e18b7925 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -447,9 +447,9 @@ def test_successful_authentication_new_user(self, token_mock, request_mock, algo 'redirect_uri': 'http://testserver/callback/', } self.assertEqual(User.objects.all().count(), 0) - self.backend.authenticate(request=auth_request) + user = self.backend.authenticate(request=auth_request) self.assertEqual(User.objects.all().count(), 1) - user = User.objects.all()[0] + self.assertEqual(user, User.objects.get()) self.assertEqual(user.email, 'email@example.com') self.assertEqual(user.username, 'username_algo')