From 501546df6f4cbb56ea94da073e8206804fef3040 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Sun, 10 Oct 2010 02:16:33 +0000 Subject: 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 --- docs/topics/testing.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'docs/topics') diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt index 28411ab05f..8a19d38f22 100644 --- a/docs/topics/testing.txt +++ b/docs/topics/testing.txt @@ -494,6 +494,8 @@ Testing tools Django provides a small set of tools that come in handy when writing tests. +.. _test-client: + The test client --------------- @@ -894,15 +896,15 @@ Specifically, a ``Response`` object has the following attributes: The HTTP status of the response, as an integer. See RFC2616_ for a full list of HTTP status codes. - .. attribute:: template + .. versionadded:: 1.3 + + .. attribute:: templates - The ``Template`` instance that was used to render the final content. Use + A list of ``Template`` instances used to render the final content, in + the order they were rendered. For each template in the list, use ``template.name`` to get the template's file name, if the template was - loaded from a file. (The name is a string such as ``'admin/index.html'``.) - - If the rendered page used multiple templates -- e.g., using :ref:`template - inheritance` -- then ``template`` will be a list of - ``Template`` instances, in the order in which they were rendered. + loaded from a file. (The name is a string such as + ``'admin/index.html'``.) You can also use dictionary syntax on the response object to query the value of any settings in the HTTP headers. For example, you could determine the -- cgit v1.3