diff options
| author | Tim Graham <timograham@gmail.com> | 2016-12-07 17:42:31 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-07 17:42:31 -0500 |
| commit | b5f0b3478dfcf0335f8ac2038d59f54b4a05f2a0 (patch) | |
| tree | f3eb61bfdcf45c7b27fe3c480e9a7533746d1aad /django/test | |
| parent | f909fa84bedb51778a175aadfe4cfe7a91fe06cd (diff) | |
Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.
Diffstat (limited to 'django/test')
| -rw-r--r-- | django/test/testcases.py | 6 |
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): |
