Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.

This commit is contained in:
Tim Graham 2016-12-07 17:42:31 -05:00 committed by GitHub
parent f909fa84be
commit b5f0b3478d
27 changed files with 84 additions and 104 deletions

View file

@ -12,7 +12,6 @@ from django.contrib.auth.hashers import (
)
from django.test import SimpleTestCase, mock
from django.test.utils import override_settings
from django.utils import six
from django.utils.encoding import force_bytes
try:
@ -436,7 +435,7 @@ class TestUtilsHashPass(SimpleTestCase):
PlainHasher = type(str('PlainHasher'), (BasePasswordHasher,), {'algorithm': 'plain', 'library': 'plain'})
# Python 3 adds quotes around module name
msg = "Couldn't load 'PlainHasher' algorithm library: No module named '?plain'?"
with six.assertRaisesRegex(self, ValueError, msg):
with self.assertRaisesRegex(ValueError, msg):
PlainHasher()._load_library()