Bert JW Regeer
2015-11-13 203cf3accd0bec0cc08eab8e736f26cd0e711d8b
Add AuthTkt test to test ticket timeouts

Previous tests did not actually test the code, other than by chance,
which meant future changes could regress, which is bad.
1 files modified
11 ■■■■■ changed files
pyramid/tests/test_authentication.py 11 ●●●●● patch | view | raw | blame | history
pyramid/tests/test_authentication.py
@@ -769,6 +769,17 @@
        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)