summaryrefslogtreecommitdiff
path: root/django/test/testcases.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-12-07 17:42:31 -0500
committerGitHub <noreply@github.com>2016-12-07 17:42:31 -0500
commitb5f0b3478dfcf0335f8ac2038d59f54b4a05f2a0 (patch)
treef3eb61bfdcf45c7b27fe3c480e9a7533746d1aad /django/test/testcases.py
parentf909fa84bedb51778a175aadfe4cfe7a91fe06cd (diff)
Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.
Diffstat (limited to 'django/test/testcases.py')
-rw-r--r--django/test/testcases.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index be5720a80b..4538716ce7 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -802,6 +802,12 @@ class SimpleTestCase(unittest.TestCase):
standardMsg = '%s == %s' % (safe_repr(xml1, True), safe_repr(xml2, True))
self.fail(self._formatMessage(msg, standardMsg))
+ if six.PY2:
+ assertCountEqual = unittest.TestCase.assertItemsEqual
+ assertNotRegex = unittest.TestCase.assertNotRegexpMatches
+ assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
+ assertRegex = unittest.TestCase.assertRegexpMatches
+
class TransactionTestCase(SimpleTestCase):