Browse files

[1.5.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.
  • Loading branch information...
1 parent b495c24 commit 9f8a36eb20895d9e542820d5190bfa77ad1b85d9 @akaariai akaariai committed Oct 9, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 django/contrib/auth/tests/hashers.py
View
4 django/contrib/auth/tests/hashers.py
@@ -16,6 +16,10 @@
try:
import bcrypt
+ # Django 1.5 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

0 comments on commit 9f8a36e

Please sign in to comment.