1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Skipped scrypt tests when OpenSSL 1.1+ is not installed.

This commit is contained in:
HieuPham9720
2022-10-20 18:50:48 -07:00
committed by GitHub
parent a16132a9c4
commit 3e928de8ad

View File

@@ -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):