diff --git a/django/contrib/auth/hashers.py b/django/contrib/auth/hashers.py
index 7658379..57b8809 100644
a
|
b
|
class CryptPasswordHasher(BasePasswordHasher):
|
602 | 602 | crypt = self._load_library() |
603 | 603 | assert len(salt) == 2 |
604 | 604 | data = crypt.crypt(force_str(password), salt) |
| 605 | assert data != None |
605 | 606 | # we don't need to store the salt, but Django used to do this |
606 | 607 | return "%s$%s$%s" % (self.algorithm, '', data) |
607 | 608 | |
diff --git a/tests/auth_tests/test_hashers.py b/tests/auth_tests/test_hashers.py
index a43c170..d5708b0 100644
a
|
b
|
try:
|
20 | 20 | except ImportError: |
21 | 21 | crypt = None |
22 | 22 | |
| 23 | # On some platform, crypt can be imported but crypt.crypt always return None |
| 24 | if crypt and crypt.crypt("") == None: |
| 25 | crypt = None |
| 26 | |
23 | 27 | try: |
24 | 28 | import bcrypt |
25 | 29 | except ImportError: |
… |
… |
try:
|
30 | 34 | except ImportError: |
31 | 35 | argon2 = None |
32 | 36 | |
33 | | |
34 | 37 | class PBKDF2SingleIterationHasher(PBKDF2PasswordHasher): |
35 | 38 | iterations = 1 |
36 | 39 | |