summaryrefslogtreecommitdiff
path: root/passlib/tests
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2011-12-06 16:08:52 -0500
committerEli Collins <elic@assurancetechnologies.com>2011-12-06 16:08:52 -0500
commitc5ec1f9c49522a357075c9a0353b028f930e04ad (patch)
tree936e96672725980be447a6601ca80444a8f36040 /passlib/tests
parente2f085dd5606c4c1547803cfcbddd5796009f50f (diff)
downloadpasslib-c5ec1f9c49522a357075c9a0353b028f930e04ad.tar.gz
added compat.unicode imports in a number of places
this distinguishes the types, so that for isinstance() tests... * 'unicode' always means the unicode type * 'bytes' always means the bytes type * 'str' always means the native string type
Diffstat (limited to 'passlib/tests')
-rw-r--r--passlib/tests/test_apache.py2
-rw-r--r--passlib/tests/test_ext_django.py2
-rw-r--r--passlib/tests/test_utils.py1
-rw-r--r--passlib/tests/test_utils_handlers.py3
-rw-r--r--passlib/tests/utils.py3
5 files changed, 7 insertions, 4 deletions
diff --git a/passlib/tests/test_apache.py b/passlib/tests/test_apache.py
index 0fb93a1..aa61543 100644
--- a/passlib/tests/test_apache.py
+++ b/passlib/tests/test_apache.py
@@ -12,7 +12,7 @@ import time
#pkg
from passlib import apache
from passlib.utils import b, native_str, bytes
-from passlib.utils.compat import irange
+from passlib.utils.compat import irange, unicode
from passlib.tests.utils import TestCase, mktemp, gae_env, get_file, set_file
#module
log = getLogger(__name__)
diff --git a/passlib/tests/test_ext_django.py b/passlib/tests/test_ext_django.py
index a7f3684..7f7d6d6 100644
--- a/passlib/tests/test_ext_django.py
+++ b/passlib/tests/test_ext_django.py
@@ -16,7 +16,7 @@ from passlib.hash import sha256_crypt
from passlib.tests.utils import TestCase, unittest, ut_version, catch_warnings
import passlib.tests.test_drivers as td
from passlib.utils import Undef
-from passlib.utils.compat import iteritems, get_method_function
+from passlib.utils.compat import iteritems, get_method_function, unicode
from passlib.registry import get_crypt_handler
#module
diff --git a/passlib/tests/test_utils.py b/passlib/tests/test_utils.py
index c851943..a9b0f48 100644
--- a/passlib/tests/test_utils.py
+++ b/passlib/tests/test_utils.py
@@ -16,6 +16,7 @@ from passlib import utils
from passlib.utils import h64, des, Undef, bytes, b, \
native_str, to_bytes, to_unicode, to_native_str, to_hash_str, \
is_same_codec, is_ascii_safe, safe_os_crypt, md4 as md4_mod
+from passlib.utils.compat import unicode
from passlib.tests.utils import TestCase, Params as ak, \
enable_option, catch_warnings
diff --git a/passlib/tests/test_utils_handlers.py b/passlib/tests/test_utils_handlers.py
index 7e4193c..dc3ae86 100644
--- a/passlib/tests/test_utils_handlers.py
+++ b/passlib/tests/test_utils_handlers.py
@@ -15,6 +15,7 @@ from passlib.registry import _unload_handler_name as unload_handler_name, \
register_crypt_handler, get_crypt_handler
from passlib.utils import rng, getrandstr, handlers as uh, bytes, b, \
to_hash_str, to_unicode, MissingBackendError, jython_vm
+from passlib.utils.compat import unicode
from passlib.tests.utils import HandlerCase, TestCase, catch_warnings, \
dummy_handler_in_registry
#module
@@ -234,7 +235,7 @@ class SkeletonTest(TestCase):
self.assertTrue(d1.has_backend())
d1.set_backend('a')
self.assertEqual(obj.calc_checksum('s'), 'a')
-
+
#test unknown backend
self.assertRaises(ValueError, d1.set_backend, 'c')
self.assertRaises(ValueError, d1.has_backend, 'c')
diff --git a/passlib/tests/utils.py b/passlib/tests/utils.py
index ae43f61..b442218 100644
--- a/passlib/tests/utils.py
+++ b/passlib/tests/utils.py
@@ -37,7 +37,8 @@ from passlib import registry, utils
from passlib.utils import classproperty, handlers as uh, \
has_rounds_info, has_salt_info, MissingBackendError, \
rounds_cost_values, b, bytes, native_str, NoneType
-from passlib.utils.compat import iteritems, irange, callable, sb_types, exc_err
+from passlib.utils.compat import iteritems, irange, callable, sb_types, \
+ exc_err, unicode
#local
__all__ = [
#util funcs