Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.6.x] Fixed a test that could fail depending on PASSWORD_HASHERS.

Thanks Claude. Refs #20760.

Backport of 5b47a9c from master.
  • Loading branch information...
commit 88e4a3a3d932997aabebba772217f954df2fd65b 1 parent 17e6329
Aymeric Augustin authored
4  django/contrib/auth/tests/test_auth_backends.py
@@ -125,6 +125,10 @@ def test_get_all_superuser_permissions(self):
125 125
     @override_settings(PASSWORD_HASHERS=('django.contrib.auth.tests.test_auth_backends.CountingMD5PasswordHasher',))
126 126
     def test_authentication_timing(self):
127 127
         """Hasher is run once regardless of whether the user exists. Refs #20760."""
  128
+        # Re-set the password, because this tests overrides PASSWORD_HASHERS
  129
+        self.user.set_password('test')
  130
+        self.user.save()
  131
+
128 132
         CountingMD5PasswordHasher.calls = 0
129 133
         username = getattr(self.user, self.UserModel.USERNAME_FIELD)
130 134
         authenticate(username=username, password='test')

0 notes on commit 88e4a3a

Please sign in to comment.
Something went wrong with that request. Please try again.