blob: b50928f73b3c8d3cdd3ba6a4941bbad9f4ae88af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python
from ...accounts.openid_store import DjangoDBOpenIDStore
from ...common.test_helpers import OkupyTestCase
import time
class OpenIDStoreTests(OkupyTestCase):
def setUp(self):
self.store = DjangoDBOpenIDStore()
def test_nonce_integrity(self):
nonce = ('http://example.com', time.time(), 'pepper')
# first one should succeed, the second one should fail because
# of reused nonce
self.assertTrue(self.store.useNonce(*nonce))
self.assertFalse(self.store.useNonce(*nonce))
|