示例#1
0
 def test_get_user_succ(self):
     user_id, user = UsersDb.get_user_by_username(TEST_USER_NAME)
     assert user_id == TEST_USER_ID
     assert user.username == TEST_USER_STORED.username
     assert user.password == TEST_USER_STORED.password
     assert user.usage_purpose == TEST_USER_STORED.usage_purpose
     assert user.time_created == TEST_USER_STORED.time_created
示例#2
0
 def test_get_user_fail(self):
     not_user = TEST_USER_NAME+'Not_existsingsjflksjf'
     with self.assertRaises(LookupError) as context:
         UsersDb.get_user_by_username(not_user)
     exc = context.exception
     assert str(exc) == f'No database document exists for user {not_user}.'