Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.4.x] Removed usage of b"" string syntax for Python 2.5 compatibility.

Refs commit 3f3d887.
  • Loading branch information...
commit 6903d1690a92aa040adfb0c8eb37cf62e4206714 1 parent 3ffc7b5
Russell Keith-Magee freakboy3742 authored
Showing with 10 additions and 10 deletions.
  1. +10 −10 django/contrib/auth/tests/hashers.py
20 django/contrib/auth/tests/hashers.py
View
@@ -33,7 +33,7 @@ def test_simple(self):
self.assertRaises(
ValueError,
make_password,
- b"1" * (MAXIMUM_PASSWORD_LENGTH + 1),
+ "1" * (MAXIMUM_PASSWORD_LENGTH + 1),
)
def test_pkbdf2(self):
@@ -47,7 +47,7 @@ def test_pkbdf2(self):
self.assertRaises(
ValueError,
make_password,
- b"1" * (MAXIMUM_PASSWORD_LENGTH + 1),
+ "1" * (MAXIMUM_PASSWORD_LENGTH + 1),
"seasalt",
"pbkdf2_sha256",
)
@@ -63,7 +63,7 @@ def test_sha1(self):
self.assertRaises(
ValueError,
make_password,
- b"1" * (MAXIMUM_PASSWORD_LENGTH + 1),
+ "1" * (MAXIMUM_PASSWORD_LENGTH + 1),
"seasalt",
"sha1",
)
@@ -79,7 +79,7 @@ def test_md5(self):
self.assertRaises(
ValueError,
make_password,
- b"1" * (MAXIMUM_PASSWORD_LENGTH + 1),
+ "1" * (MAXIMUM_PASSWORD_LENGTH + 1),
"seasalt",
"md5",
)
@@ -99,7 +99,7 @@ def test_unsalted_md5(self):
self.assertRaises(
ValueError,
make_password,
- b"1" * (MAXIMUM_PASSWORD_LENGTH + 1),
+ "1" * (MAXIMUM_PASSWORD_LENGTH + 1),
"",
"unsalted_md5",
)
@@ -117,7 +117,7 @@ def test_unsalted_sha1(self):
self.assertRaises(
ValueError,
make_password,
- b"1" * (MAXIMUM_PASSWORD_LENGTH + 1),
+ "1" * (MAXIMUM_PASSWORD_LENGTH + 1),
"",
"unslated_sha1",
)
@@ -133,7 +133,7 @@ def test_crypt(self):
self.assertRaises(
ValueError,
make_password,
- b"1" * (MAXIMUM_PASSWORD_LENGTH + 1),
+ "1" * (MAXIMUM_PASSWORD_LENGTH + 1),
"seasalt",
"crypt",
)
@@ -149,7 +149,7 @@ def test_bcrypt(self):
self.assertRaises(
ValueError,
make_password,
- b"1" * (MAXIMUM_PASSWORD_LENGTH + 1),
+ "1" * (MAXIMUM_PASSWORD_LENGTH + 1),
hasher="bcrypt",
)
@@ -172,8 +172,8 @@ def test_max_password_length_decorator(self):
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()
Please sign in to comment.
Something went wrong with that request. Please try again.