def test_get_user_by_id_fail(self): not_user = TEST_USER_ID+'Not_existsingsjflksjf' with self.assertRaises(LookupError) as context: UsersDb.get_user_by_id(not_user) exc = context.exception assert str(exc) == f'User with id {not_user} does not exist.'
def test_get_user_by_id_succ(self): user = UsersDb.get_user_by_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