diff --git a/django/test/client.py b/django/test/client.py index 4f097269007..67866e9babe 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -410,7 +410,7 @@ class Client(RequestFactory): # Provide a backwards-compatible (but pending deprecation) response.template def _get_template(self): warnings.warn("response.template is deprecated; use response.templates instead (which is always a list)", - PendingDeprecationWarning) + PendingDeprecationWarning, stacklevel=2) if not self.templates: return None elif len(self.templates) == 1: