Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Worked around Python 3.3 modified exception repr

Refs #20599.
  • Loading branch information...
commit beb652e069d386fa6295dd235d7ba84a95e9d484 1 parent 990f8d9
@claudep claudep authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/contrib/auth/tests/
7 django/contrib/auth/tests/
@@ -5,6 +5,7 @@
from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
check_password, make_password, PBKDF2PasswordHasher, load_hashers,
PBKDF2SHA1PasswordHasher, get_hasher, identify_hasher, UNUSABLE_PASSWORD)
+from django.utils import six
from django.utils import unittest
from django.utils.unittest import skipUnless
@@ -187,7 +188,7 @@ def test_load_library_no_algorithm(self):
def test_load_library_importerror(self):
PlainHasher = type(str('PlainHasher'), (BasePasswordHasher,),
{'algorithm': 'plain', 'library': 'plain'})
- with self.assertRaises(ValueError) as e:
+ # Python 3.3 adds quotes around module name
+ with six.assertRaisesRegex(self, ValueError,
+ "Couldn't load 'PlainHasher' algorithm library: No module named '?plain'?"):
- self.assertEqual("Couldn't load 'PlainHasher' algorithm library: "
- "No module named plain", str(e.exception))

0 comments on commit beb652e

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