Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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...
commit 9f8a36eb20895d9e542820d5190bfa77ad1b85d9 1 parent b495c24
Anssi Kääriäinen authored

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  django/contrib/auth/tests/hashers.py
4  django/contrib/auth/tests/hashers.py
@@ -16,6 +16,10 @@
16 16
 
17 17
 try:
18 18
     import bcrypt
  19
+    # Django 1.5 works only with py-bcrypt, not with bcrypt. py-bcrypt has
  20
+    # '_bcrypt' attribute, bcrypt doesn't.
  21
+    if not hasattr(bcrypt, '_bcrypt'):
  22
+        bcrypt = None
19 23
 except ImportError:
20 24
     bcrypt = None
21 25
 

0 notes on commit 9f8a36e

Please sign in to comment.
Something went wrong with that request. Please try again.