def __init__(self, name, email, password): self.name = name self.email = email self.password_hash = generate_password_hash(password)
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.", )
def test_can_hash_multibyte_unicode(self): generate_password_hash(self.utf8_pw)
def test_can_hash_unicode(self): generate_password_hash(unicode(self.passwd))
def test_can_hash_string(self): generate_password_hash(self.passwd)
def hash_and_check(self, real_password, attempted_password): hashed_password = generate_password_hash(real_password) return password_matches_hash(attempted_password, hashed_password)