def login(username, passwd): passwd = hash.md5_hash(passwd) if (validate(username, passwd)): print("User verified") else: print("User not in DB")
def test_generate(self): code = server.generate_shortcode() self.assertTrue(server.validate(code))
def test_success_validate(self): valid_code = 'awk_11' self.assertEqual(True, server.validate(valid_code))
def test_fail_validate3(self): valid_code = 'awk' self.assertEqual(False, server.validate(valid_code))