Skipped scrypt tests when OpenSSL 1.1+ is not installed.
@@ -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):
