forked from s3lph/matemat
Added verification of receipt_pref to login test.
This commit is contained in:
parent
53233d74c3
commit
71d7bb85ce
1 changed files with 2 additions and 1 deletions
|
@ -100,7 +100,7 @@ class DatabaseTest(unittest.TestCase):
|
|||
except AuthenticationError as e:
|
||||
self.assertEqual('Touchkey not set', e.msg)
|
||||
# Add a touchkey without using the provided function
|
||||
c.execute('''UPDATE users SET touchkey = :tkhash WHERE user_id = :user_id''', {
|
||||
c.execute('''UPDATE users SET touchkey = :tkhash, receipt_pref = 2 WHERE user_id = :user_id''', {
|
||||
'tkhash': crypt.crypt('0123', crypt.mksalt()),
|
||||
'user_id': u.id
|
||||
})
|
||||
|
@ -108,6 +108,7 @@ class DatabaseTest(unittest.TestCase):
|
|||
self.assertEqual(u.id, user.id)
|
||||
user = db.login('testuser', touchkey='0123')
|
||||
self.assertEqual(u.id, user.id)
|
||||
self.assertEqual(2, user.receipt_pref)
|
||||
with self.assertRaises(AuthenticationError):
|
||||
# Inexistent user should fail
|
||||
db.login('nooone', 'supersecurepassword')
|
||||
|
|
Loading…
Reference in a new issue