1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Removed all usages of deprecated TestCase methods (self.fail*). This removed most of the Warnings emitted (with -Wall) during the test suite.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2010-12-04 07:28:12 +00:00
parent 6770c36262
commit 5bc0ec4ec4
30 changed files with 386 additions and 379 deletions

View File

@@ -355,7 +355,7 @@ class TransactionTestCase(ut2.TestCase):
if hasattr(response, 'redirect_chain'):
# The request was a followed redirect
self.failUnless(len(response.redirect_chain) > 0,
self.assertTrue(len(response.redirect_chain) > 0,
msg_prefix + "Response didn't redirect as expected: Response"
" code was %d (expected %d)" %
(response.status_code, status_code))
@@ -469,7 +469,7 @@ class TransactionTestCase(ut2.TestCase):
if field:
if field in context[form].errors:
field_errors = context[form].errors[field]
self.failUnless(err in field_errors,
self.assertTrue(err in field_errors,
msg_prefix + "The field '%s' on form '%s' in"
" context %d does not contain the error '%s'"
" (actual errors: %s)" %
@@ -484,7 +484,7 @@ class TransactionTestCase(ut2.TestCase):
(form, i, field))
else:
non_field_errors = context[form].non_field_errors()
self.failUnless(err in non_field_errors,
self.assertTrue(err in non_field_errors,
msg_prefix + "The form '%s' in context %d does not"
" contain the non-field error '%s'"
" (actual errors: %s)" %
@@ -504,7 +504,7 @@ class TransactionTestCase(ut2.TestCase):
template_names = [t.name for t in response.templates]
if not template_names:
self.fail(msg_prefix + "No templates used to render the response")
self.failUnless(template_name in template_names,
self.assertTrue(template_name in template_names,
msg_prefix + "Template '%s' was not a template used to render"
" the response. Actual template(s) used: %s" %
(template_name, u', '.join(template_names)))
@@ -518,7 +518,7 @@ class TransactionTestCase(ut2.TestCase):
msg_prefix += ": "
template_names = [t.name for t in response.templates]
self.failIf(template_name in template_names,
self.assertFalse(template_name in template_names,
msg_prefix + "Template '%s' was used unexpectedly in rendering"
" the response" % template_name)