def authenticate(username, password): return User.authenticate(username, password)
def test_fail_to_authenticate_unknown_user(self): with self.app.app_context(): self.assertFalse(User.authenticate("user2", "password"))
def test_authenticate(self): with self.app.app_context(): self.assertTrue(User.authenticate("user1", "password"))
def test_fail_to_authenticate_with_invalid_password(self): with self.app.app_context(): self.assertFalse(User.authenticate("user1", "password1"))