mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.
This commit is contained in:
parent
f909fa84be
commit
b5f0b3478d
27 changed files with 84 additions and 104 deletions
|
@ -368,16 +368,15 @@ class AssertTemplateUsedContextManagerTests(SimpleTestCase):
|
|||
pass
|
||||
|
||||
def test_error_message(self):
|
||||
with six.assertRaisesRegex(self, AssertionError, r'^template_used/base\.html'):
|
||||
with self.assertRaisesRegex(AssertionError, r'^template_used/base\.html'):
|
||||
with self.assertTemplateUsed('template_used/base.html'):
|
||||
pass
|
||||
|
||||
with six.assertRaisesRegex(self, AssertionError, r'^template_used/base\.html'):
|
||||
with self.assertRaisesRegex(AssertionError, r'^template_used/base\.html'):
|
||||
with self.assertTemplateUsed(template_name='template_used/base.html'):
|
||||
pass
|
||||
|
||||
with six.assertRaisesRegex(
|
||||
self, AssertionError, r'^template_used/base\.html.*template_used/alternative\.html$'):
|
||||
with self.assertRaisesRegex(AssertionError, r'^template_used/base\.html.*template_used/alternative\.html$'):
|
||||
with self.assertTemplateUsed('template_used/base.html'):
|
||||
render_to_string('template_used/alternative.html')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue