def test_verify_password(self): auth_user = AuthUser() auth_user.password = "******" auth_user.active = True auth_user.email = "*****@*****.**" DBSession.add(auth_user) iscorrect = auth_user.verify_password("test12345") self.assertEqual(iscorrect, True)
def test_create_token(self): user = create_user() auth_user = AuthUser() auth_user.user_id = user.id auth_user.password = "******" auth_user.active = True auth_user.email = "*****@*****.**" DBSession.add(auth_user) if auth_user.verify_password("test12345"): token = auth_user.get_or_create_token() self.assertNotEqual(token, None)