summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyramid/tests/test_authentication.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pyramid/tests/test_authentication.py b/pyramid/tests/test_authentication.py
index 4a6525af2..0a22e5965 100644
--- a/pyramid/tests/test_authentication.py
+++ b/pyramid/tests/test_authentication.py
@@ -769,6 +769,17 @@ class TestAuthTktCookieHelper(unittest.TestCase):
helper = self._makeOne('secret', timeout='1')
self.assertEqual(helper.timeout, 1)
+ def test_identify_cookie_timeout_aged(self):
+ import time
+ helper = self._makeOne('secret', timeout=10)
+ now = time.time()
+ helper.auth_tkt.timestamp = now - 1
+ helper.now = now + 10
+ helper.auth_tkt.tokens = (text_('a'), )
+ request = self._makeRequest('bogus')
+ result = helper.identify(request)
+ self.assertFalse(result)
+
def test_identify_cookie_reissue(self):
import time
helper = self._makeOne('secret', timeout=10, reissue_time=0)