[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.
This commit is contained in:
Anssi Kääriäinen 2013-10-09 14:20:37 +03:00
parent b495c24375
commit 9f8a36eb20
1 changed files with 4 additions and 0 deletions

View File

@ -16,6 +16,10 @@ except ImportError:
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