fix test_html and test_template for py3

This commit is contained in:
ilvalle
2016-06-03 11:46:32 +02:00
parent db8306b5c4
commit 97eb013831
12 changed files with 266 additions and 224 deletions
+3
View File
@@ -93,6 +93,9 @@ def simple_hash(text, key='', salt='', digest_alg='md5'):
Generates hash with the given text using the specified
digest hashing algorithm
"""
text = to_bytes(text)
key = to_bytes(key)
salt = to_bytes(salt)
if not digest_alg:
raise RuntimeError("simple_hash with digest_alg=None")
elif not isinstance(digest_alg, str): # manual approach