summaryrefslogtreecommitdiff
path: root/tests/auth_tests
diff options
context:
space:
mode:
authorHieuPham9720 <44531309+HieuPham9720@users.noreply.github.com>2022-10-20 18:50:48 -0700
committerGitHub <noreply@github.com>2022-10-20 18:50:48 -0700
commit3e928de8add92a5f38a562abd7560b023d24b6af (patch)
treed8bd28827cde4ef20878413139b7126a7128abdc /tests/auth_tests
parenta16132a9c4b32f9580cdda98a2711ae7261c2576 (diff)
downloaddjango-3e928de8add92a5f38a562abd7560b023d24b6af.tar.gz
Skipped scrypt tests when OpenSSL 1.1+ is not installed.
Diffstat (limited to 'tests/auth_tests')
-rw-r--r--tests/auth_tests/test_hashers.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auth_tests/test_hashers.py b/tests/auth_tests/test_hashers.py
index a5dfd51a6b..4d718da46a 100644
--- a/tests/auth_tests/test_hashers.py
+++ b/tests/auth_tests/test_hashers.py
@@ -41,6 +41,14 @@ try:
except ImportError:
argon2 = None
+# scrypt requires OpenSSL 1.1+
+try:
+ import hashlib
+
+ scrypt = hashlib.scrypt
+except ImportError:
+ scrypt = None
+
class PBKDF2SingleIterationHasher(PBKDF2PasswordHasher):
iterations = 1
@@ -797,6 +805,7 @@ class TestUtilsHashPassArgon2(SimpleTestCase):
setattr(hasher, attr, old_value)
+@skipUnless(scrypt, "scrypt not available")
@override_settings(PASSWORD_HASHERS=PASSWORD_HASHERS)
class TestUtilsHashPassScrypt(SimpleTestCase):
def test_scrypt(self):