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