def verify_password(username, password): if not username: return False resp = g.db.execute("""select username, password from users where username == ?""", (username,)).fetchone() if not resp: return False user, b64pwd = resp if not user or not cryptohelper.check_pwd(password, b64pwd): return False return True
def test_check_pwd(self): self.assertTrue(cryptohelper.check_pwd(self.password, self.b64str, rounds=self.rounds))