mirror of
https://github.com/django/django.git
synced 2025-03-31 19:46:42 +00:00
Fixed random auth_tests.test_tokens.TokenGeneratorTest.test_10265 failures.
Random failures depended on the current timestamp.
This commit is contained in:
parent
3b4b36fb1d
commit
ca0d50f34a
@ -27,12 +27,11 @@ class TokenGeneratorTest(TestCase):
|
|||||||
The token generated for a user created in the same request
|
The token generated for a user created in the same request
|
||||||
will work correctly.
|
will work correctly.
|
||||||
"""
|
"""
|
||||||
# See ticket #10265
|
|
||||||
user = User.objects.create_user('comebackkid', 'test3@example.com', 'testpw')
|
user = User.objects.create_user('comebackkid', 'test3@example.com', 'testpw')
|
||||||
p0 = PasswordResetTokenGenerator()
|
user_reload = User.objects.get(username='comebackkid')
|
||||||
|
p0 = MockedPasswordResetTokenGenerator(datetime.now())
|
||||||
tk1 = p0.make_token(user)
|
tk1 = p0.make_token(user)
|
||||||
reload = User.objects.get(username='comebackkid')
|
tk2 = p0.make_token(user_reload)
|
||||||
tk2 = p0.make_token(reload)
|
|
||||||
self.assertEqual(tk1, tk2)
|
self.assertEqual(tk1, tk2)
|
||||||
|
|
||||||
def test_timeout(self):
|
def test_timeout(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user