def test_user_incorrect_password(self): email = 'email' password = '******' add_to_database(User(email=email, password=password)) user = User.get_user_by_email(email) assert user.password != password assert not bcrypt.check_password_hash(user.password, 'temp') assert bcrypt.check_password_hash(user.password, password)
def check_password(self, password): return bcrypt.check_password_hash(self.password, password)