Made the deprecation warning for reponse.template more useful by pointing to the caller.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14525 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2010-11-11 15:04:37 +00:00
parent b0590110c7
commit 7beca4d3e5
1 changed files with 1 additions and 1 deletions

View File

@ -410,7 +410,7 @@ class Client(RequestFactory):
# Provide a backwards-compatible (but pending deprecation) response.template # Provide a backwards-compatible (but pending deprecation) response.template
def _get_template(self): def _get_template(self):
warnings.warn("response.template is deprecated; use response.templates instead (which is always a list)", warnings.warn("response.template is deprecated; use response.templates instead (which is always a list)",
PendingDeprecationWarning) PendingDeprecationWarning, stacklevel=2)
if not self.templates: if not self.templates:
return None return None
elif len(self.templates) == 1: elif len(self.templates) == 1: