diff --git a/django/contrib/formtools/wizard/tests/cookiestoragetests.py b/django/contrib/formtools/wizard/tests/cookiestoragetests.py
index 74c7e82..6ad9bce 100644
a
|
b
|
class TestCookieStorage(TestStorage, TestCase):
|
25 | 25 | self.assertRaises(SuspiciousOperation, storage.load_data) |
26 | 26 | |
27 | 27 | def test_reset_cookie(self): |
| 28 | from django.core.signing import SignatureExpired |
28 | 29 | request = get_request() |
29 | 30 | storage = self.get_storage()('wizard1', request, None) |
30 | 31 | |
… |
… |
class TestCookieStorage(TestStorage, TestCase):
|
35 | 36 | |
36 | 37 | cookie_signer = signing.get_cookie_signer(storage.prefix) |
37 | 38 | signed_cookie_data = cookie_signer.sign(storage.encoder.encode(storage.data)) |
38 | | self.assertEqual(response.cookies[storage.prefix].value, signed_cookie_data) |
| 39 | |
| 40 | # signing with different timestamps generates different signatures |
| 41 | self.assertNotEqual(response.cookies[storage.prefix].value, signed_cookie_data) |
| 42 | self.assertEqual(cookie_signer.unsign(response.cookies[storage.prefix].value), |
| 43 | cookie_signer.unsign(signed_cookie_data)) |
| 44 | self.assertRaises(SignatureExpired, |
| 45 | lambda: cookie_signer.unsign(value=response.cookies[storage.prefix].value, max_age=0)) |
| 46 | self.assertEqual(cookie_signer.unsign(value=response.cookies[storage.prefix].value, max_age=10), |
| 47 | cookie_signer.unsign(signed_cookie_data)) |
39 | 48 | |
40 | 49 | storage.init_data() |
41 | 50 | storage.update_response(response) |