summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_hashers.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-02-26 09:05:18 -0500
committerGitHub <noreply@github.com>2018-02-26 09:05:18 -0500
commit5b589a47b9ac2c8bdd13ba837fea37991a1457b9 (patch)
tree6a4691049c41e15b1ea10fd41ae6e008ee98c916 /tests/auth_tests/test_hashers.py
parentc4fa0143f7117a07a3f0258a063f5265e795ffbb (diff)
Fixed #29161 -- Removed BCryptPasswordHasher from PASSWORD_HASHERS.
Diffstat (limited to 'tests/auth_tests/test_hashers.py')
-rw-r--r--tests/auth_tests/test_hashers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auth_tests/test_hashers.py b/tests/auth_tests/test_hashers.py
index 109aa74153..51aaa3d72c 100644
--- a/tests/auth_tests/test_hashers.py
+++ b/tests/auth_tests/test_hashers.py
@@ -172,6 +172,7 @@ class TestUtilsHashPass(SimpleTestCase):
self.assertFalse(check_password(' ', blank_encoded))
@skipUnless(bcrypt, "bcrypt not installed")
+ @override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.BCryptPasswordHasher'])
def test_bcrypt(self):
encoded = make_password('lètmein', hasher='bcrypt')
self.assertTrue(is_password_usable(encoded))
@@ -187,6 +188,7 @@ class TestUtilsHashPass(SimpleTestCase):
self.assertFalse(check_password(' ', blank_encoded))
@skipUnless(bcrypt, "bcrypt not installed")
+ @override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.BCryptPasswordHasher'])
def test_bcrypt_upgrade(self):
hasher = get_hasher('bcrypt')
self.assertEqual('bcrypt', hasher.algorithm)
@@ -219,6 +221,7 @@ class TestUtilsHashPass(SimpleTestCase):
hasher.rounds = old_rounds
@skipUnless(bcrypt, "bcrypt not installed")
+ @override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.BCryptPasswordHasher'])
def test_bcrypt_harden_runtime(self):
hasher = get_hasher('bcrypt')
self.assertEqual('bcrypt', hasher.algorithm)