diff options
author | Russell Keith-Magee <russell@keith-magee.com> | 2013-09-15 14:02:38 +0800 |
---|---|---|
committer | Russell Keith-Magee <russell@keith-magee.com> | 2013-09-15 14:02:38 +0800 |
commit | 6903d1690a92aa040adfb0c8eb37cf62e4206714 (patch) | |
tree | d3d0b8b699dbb39fd71b373e33d2db1fd3467d7a | |
parent | 3ffc7b52f8704443ef0c20f34bb50c9144898ef7 (diff) | |
download | django-1.4.8.tar.gz |
[1.4.x] Removed usage of b"" string syntax for Python 2.5 compatibility.1.4.8
Refs commit 3f3d887a6844ec2db743fee64c9e53e04d39a368.
-rw-r--r-- | django/contrib/auth/tests/hashers.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/django/contrib/auth/tests/hashers.py b/django/contrib/auth/tests/hashers.py index d1d834c662..93d4f4decb 100644 --- a/django/contrib/auth/tests/hashers.py +++ b/django/contrib/auth/tests/hashers.py @@ -33,7 +33,7 @@ class TestUtilsHashPass(unittest.TestCase): self.assertRaises( ValueError, make_password, - b"1" * (MAXIMUM_PASSWORD_LENGTH + 1), + "1" * (MAXIMUM_PASSWORD_LENGTH + 1), ) def test_pkbdf2(self): @@ -47,7 +47,7 @@ class TestUtilsHashPass(unittest.TestCase): self.assertRaises( ValueError, make_password, - b"1" * (MAXIMUM_PASSWORD_LENGTH + 1), + "1" * (MAXIMUM_PASSWORD_LENGTH + 1), "seasalt", "pbkdf2_sha256", ) @@ -63,7 +63,7 @@ class TestUtilsHashPass(unittest.TestCase): self.assertRaises( ValueError, make_password, - b"1" * (MAXIMUM_PASSWORD_LENGTH + 1), + "1" * (MAXIMUM_PASSWORD_LENGTH + 1), "seasalt", "sha1", ) @@ -79,7 +79,7 @@ class TestUtilsHashPass(unittest.TestCase): self.assertRaises( ValueError, make_password, - b"1" * (MAXIMUM_PASSWORD_LENGTH + 1), + "1" * (MAXIMUM_PASSWORD_LENGTH + 1), "seasalt", "md5", ) @@ -99,7 +99,7 @@ class TestUtilsHashPass(unittest.TestCase): self.assertRaises( ValueError, make_password, - b"1" * (MAXIMUM_PASSWORD_LENGTH + 1), + "1" * (MAXIMUM_PASSWORD_LENGTH + 1), "", "unsalted_md5", ) @@ -117,7 +117,7 @@ class TestUtilsHashPass(unittest.TestCase): self.assertRaises( ValueError, make_password, - b"1" * (MAXIMUM_PASSWORD_LENGTH + 1), + "1" * (MAXIMUM_PASSWORD_LENGTH + 1), "", "unslated_sha1", ) @@ -133,7 +133,7 @@ class TestUtilsHashPass(unittest.TestCase): self.assertRaises( ValueError, make_password, - b"1" * (MAXIMUM_PASSWORD_LENGTH + 1), + "1" * (MAXIMUM_PASSWORD_LENGTH + 1), "seasalt", "crypt", ) @@ -149,7 +149,7 @@ class TestUtilsHashPass(unittest.TestCase): self.assertRaises( ValueError, make_password, - b"1" * (MAXIMUM_PASSWORD_LENGTH + 1), + "1" * (MAXIMUM_PASSWORD_LENGTH + 1), hasher="bcrypt", ) @@ -172,8 +172,8 @@ class TestUtilsHashPass(unittest.TestCase): def encode(s, password, salt): return True - self.assertTrue(encode(None, b"1234", b"1234")) - self.assertRaises(ValueError, encode, None, b"1234567890A", b"1234") + self.assertTrue(encode(None, "1234", "1234")) + self.assertRaises(ValueError, encode, None, "1234567890A", "1234") def test_low_level_pkbdf2(self): hasher = PBKDF2PasswordHasher() |