Beispiel #1
0
 def __init__(self, name, email, password):
     self.name = name
     self.email = email
     self.password_hash = generate_password_hash(password)
Beispiel #2
0
 def test_can_verify_against_unicode_hash(self):
     utf8_hash = unicode(generate_password_hash(self.passwd))
     self.assertTrue(
         expr=password_matches_hash(self.passwd, utf8_hash),
         msg="ASCII password didn't match hash generated from utf8 version of itself.",
     )
Beispiel #3
0
 def test_can_hash_multibyte_unicode(self):
     generate_password_hash(self.utf8_pw)
Beispiel #4
0
 def test_can_hash_unicode(self):
     generate_password_hash(unicode(self.passwd))
Beispiel #5
0
 def test_can_hash_string(self):
     generate_password_hash(self.passwd)
Beispiel #6
0
 def hash_and_check(self, real_password, attempted_password):
     hashed_password = generate_password_hash(real_password)
     return password_matches_hash(attempted_password, hashed_password)