summaryrefslogtreecommitdiff
path: root/passlib/tests
diff options
context:
space:
mode:
Diffstat (limited to 'passlib/tests')
-rw-r--r--passlib/tests/test_context.py5
-rw-r--r--passlib/tests/test_utils_handlers.py7
2 files changed, 6 insertions, 6 deletions
diff --git a/passlib/tests/test_context.py b/passlib/tests/test_context.py
index f323080..8bb4e3e 100644
--- a/passlib/tests/test_context.py
+++ b/passlib/tests/test_context.py
@@ -15,7 +15,6 @@ from passlib import hash
from passlib.context import CryptContext, LazyCryptContext
from passlib.exc import PasslibConfigWarning, PasslibHashWarning
from passlib.utils import tick, to_unicode
-from passlib.utils.compat import str_to_uascii
import passlib.utils.handlers as uh
from passlib.tests.utils import (TestCase, set_file, TICK_RESOLUTION,
quicksleep, time_call, handler_derived_from)
@@ -1155,7 +1154,7 @@ sha512_crypt__min_rounds = 45000
from hashlib import md5
if isinstance(secret, str):
secret = secret.encode("utf-8")
- return str_to_uascii(md5(secret).hexdigest())
+ return md5(secret).hexdigest()
# calling needs_update should query callback
ctx = CryptContext([dummy])
@@ -1710,7 +1709,7 @@ class DelayHash(uh.StaticHandler):
time.sleep(self.delay)
if isinstance(secret, str):
secret = secret.encode("utf-8")
- return str_to_uascii(hashlib.sha1(b"prefix" + secret).hexdigest())
+ return hashlib.sha1(b"prefix" + secret).hexdigest()
#=============================================================================
# LazyCryptContext
diff --git a/passlib/tests/test_utils_handlers.py b/passlib/tests/test_utils_handlers.py
index 422c87d..a9c3b05 100644
--- a/passlib/tests/test_utils_handlers.py
+++ b/passlib/tests/test_utils_handlers.py
@@ -11,7 +11,6 @@ import warnings
# pkg
from passlib.hash import ldap_md5, sha256_crypt
from passlib.exc import MissingBackendError, PasslibHashWarning
-from passlib.utils.compat import str_to_uascii
import passlib.utils.handlers as uh
from passlib.tests.utils import HandlerCase, TestCase
# module
@@ -748,7 +747,8 @@ class UnsaltedHash(uh.StaticHandler):
if isinstance(secret, str):
secret = secret.encode("utf-8")
data = b"boblious" + secret
- return str_to_uascii(hashlib.sha1(data).hexdigest())
+ return hashlib.sha1(data).hexdigest()
+
class SaltedHash(uh.HasSalt, uh.GenericHandler):
"""test algorithm with a salt"""
@@ -778,7 +778,8 @@ class SaltedHash(uh.HasSalt, uh.GenericHandler):
if isinstance(secret, str):
secret = secret.encode("utf-8")
data = self.salt.encode("ascii") + secret + self.salt.encode("ascii")
- return str_to_uascii(hashlib.sha1(data).hexdigest())
+ return hashlib.sha1(data).hexdigest()
+
#=============================================================================
# test sample algorithms - really a self-test of HandlerCase