summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-10-09 14:20:37 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2013-10-09 14:44:43 +0300
commit037ec1054ca8c08e65307f53e5851fe50ac5e8bf (patch)
treeac4936bf6e3118259d6445b28270d15b28352201
parente2403db95a494c0660ef09f94d9fca1604111be2 (diff)
[1.4.x] Fixed #21248 -- Skipped test_bcrypt if no py-bcrypt found
Pre 1.6 Django worked only with py-bcrypt, not with bcrypt. Skipped test_bcrypt when using bcrypt to avoid false positives. Backpatch of 9f8a36eb20895d9e542820d5190bfa77ad1b85d9 from stable/1.5.x.
-rw-r--r--django/contrib/auth/tests/hashers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/contrib/auth/tests/hashers.py b/django/contrib/auth/tests/hashers.py
index bf68c45a1b..cf383e3da1 100644
--- a/django/contrib/auth/tests/hashers.py
+++ b/django/contrib/auth/tests/hashers.py
@@ -14,6 +14,10 @@ except ImportError:
try:
import bcrypt
+ # Django 1.4 works only with py-bcrypt, not with bcrypt. py-bcrypt has
+ # '_bcrypt' attribute, bcrypt doesn't.
+ if not hasattr(bcrypt, '_bcrypt'):
+ bcrypt = None
except ImportError:
bcrypt = None