blob: 4d5a75a3678daa60950e9be61c03ddbf4f5b975e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python
from django.test import TestCase
from ...accounts.openid_store import DjangoDBOpenIDStore
import time
class OpenIDStoreTests(TestCase):
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))
|