Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #17640 -- Avoided a DeprecationWarning in the test suite. Thank…

…s zsiciarz and claudep.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17492 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8be356ea99489e932174f7c1d54d2ff766a52311 1 parent ad8022f
Aymeric Augustin aaugustin authored
Showing with 3 additions and 10 deletions.
  1. +3 −10 tests/regressiontests/test_utils/tests.py
13 tests/regressiontests/test_utils/tests.py
View
@@ -136,24 +136,17 @@ def test_not_used(self):
pass
def test_error_message(self):
- try:
+ with self.assertRaisesRegexp(AssertionError, r'^template_used/base\.html'):
with self.assertTemplateUsed('template_used/base.html'):
pass
- except AssertionError, e:
- self.assertTrue('template_used/base.html' in e.message)
- try:
+ with self.assertRaisesRegexp(AssertionError, r'^template_used/base\.html'):
with self.assertTemplateUsed(template_name='template_used/base.html'):
pass
- except AssertionError, e:
- self.assertTrue('template_used/base.html' in e.message)
- try:
+ with self.assertRaisesRegexp(AssertionError, r'^template_used/base\.html.*template_used/alternative\.html$'):
with self.assertTemplateUsed('template_used/base.html'):
render_to_string('template_used/alternative.html')
- except AssertionError, e:
- self.assertTrue('template_used/base.html' in e.message, e.message)
- self.assertTrue('template_used/alternative.html' in e.message, e.message)
def test_failure(self):
with self.assertRaises(TypeError):
Please sign in to comment.
Something went wrong with that request. Please try again.