mirror of https://github.com/django/django.git
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:
parent
b0590110c7
commit
7beca4d3e5
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue