mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #12226 -- Deprecated test client Response.template attribute in favor of templates attribute, which is always a list. Thanks Russell for patch review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -443,7 +443,7 @@ class TransactionTestCase(unittest.TestCase):
|
||||
if msg_prefix:
|
||||
msg_prefix += ": "
|
||||
|
||||
template_names = [t.name for t in to_list(response.template)]
|
||||
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,
|
||||
@@ -459,7 +459,7 @@ class TransactionTestCase(unittest.TestCase):
|
||||
if msg_prefix:
|
||||
msg_prefix += ": "
|
||||
|
||||
template_names = [t.name for t in to_list(response.template)]
|
||||
template_names = [t.name for t in response.templates]
|
||||
self.failIf(template_name in template_names,
|
||||
msg_prefix + "Template '%s' was used unexpectedly in rendering"
|
||||
" the response" % template_name)
|
||||
|
||||
Reference in New Issue
Block a user