コード例 #1
0
ファイル: models.py プロジェクト: shunyata/nobooru
 def __init__(self, name, email, password):
     self.name = name
     self.email = email
     self.password_hash = generate_password_hash(password)
コード例 #2
0
ファイル: crypto_tests.py プロジェクト: shunyata/nobooru
 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.",
     )
コード例 #3
0
ファイル: crypto_tests.py プロジェクト: shunyata/nobooru
 def test_can_hash_multibyte_unicode(self):
     generate_password_hash(self.utf8_pw)
コード例 #4
0
ファイル: crypto_tests.py プロジェクト: shunyata/nobooru
 def test_can_hash_unicode(self):
     generate_password_hash(unicode(self.passwd))
コード例 #5
0
ファイル: crypto_tests.py プロジェクト: shunyata/nobooru
 def test_can_hash_string(self):
     generate_password_hash(self.passwd)
コード例 #6
0
ファイル: crypto_tests.py プロジェクト: shunyata/nobooru
 def hash_and_check(self, real_password, attempted_password):
     hashed_password = generate_password_hash(real_password)
     return password_matches_hash(attempted_password, hashed_password)