From 71d7bb85cee1aa4c79dd9c51b003054f35953245 Mon Sep 17 00:00:00 2001 From: s3lph Date: Sun, 9 Sep 2018 03:40:06 +0200 Subject: [PATCH] Added verification of receipt_pref to login test. --- matemat/db/test/test_facade.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/matemat/db/test/test_facade.py b/matemat/db/test/test_facade.py index 5b4089e..974056e 100644 --- a/matemat/db/test/test_facade.py +++ b/matemat/db/test/test_facade.py @@ -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')