summaryrefslogtreecommitdiff
path: root/docs/testing.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-09-05 20:01:24 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-09-05 20:01:24 +0000
commit976acdc7743180993dc8257f5d256206857e8160 (patch)
treede6c056010fac0e747043b34dcfdb5f4b7510d6d /docs/testing.txt
parentbd01c6ee5703f8efec06f65374c7961458de6ea6 (diff)
newforms-admin: Merged to [6050]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6051 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/testing.txt')
-rw-r--r--docs/testing.txt29
1 files changed, 17 insertions, 12 deletions
diff --git a/docs/testing.txt b/docs/testing.txt
index e27479cc34..22a7e48a7a 100644
--- a/docs/testing.txt
+++ b/docs/testing.txt
@@ -577,13 +577,25 @@ Specifically, a ``Response`` object has the following attributes:
=============== ==========================================================
Attribute Description
=============== ==========================================================
- ``status_code`` The HTTP status of the response, as an integer. See
- RFC2616_ for a full list of HTTP status codes.
+ ``client`` The test client that was used to make the request that
+ resulted in the response.
``content`` The body of the response, as a string. This is the final
page content as rendered by the view, or any error
message (such as the URL for a 302 redirect).
+ ``context`` The template ``Context`` instance that was used to render
+ the template that produced the response content.
+
+ If the rendered page used multiple templates, then
+ ``context`` will be a list of ``Context``
+ objects, in the order in which they were rendered.
+
+ ``request`` The request data that stimulated the response.
+
+ ``status_code`` The HTTP status of the response, as an integer. See
+ RFC2616_ for a full list of HTTP status codes.
+
``template`` The ``Template`` instance that was used to render the
final content. Use ``template.name`` to get the
template's file name, if the template was loaded from a
@@ -594,13 +606,6 @@ Specifically, a ``Response`` object has the following attributes:
using `template inheritance`_ -- then ``template`` will
be a list of ``Template`` instances, in the order in
which they were rendered.
-
- ``context`` The template ``Context`` instance that was used to render
- the template that produced the response content.
-
- As with ``template``, if the rendered page used multiple
- templates, then ``context`` will be a list of ``Context``
- objects, in the order in which they were rendered.
=============== ==========================================================
.. _RFC2616: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
@@ -826,10 +831,10 @@ useful for testing Web applications:
Asserts that the template with the given name was *not* used in rendering
the response.
-``assertRedirects(response, expected_path, status_code=302, target_status_code=200)``
+``assertRedirects(response, expected_url, status_code=302, target_status_code=200)``
Asserts that the response return a ``status_code`` redirect status,
- it redirected to ``expected_path`` and the subsequent page was received with
- ``target_status_code``.
+ it redirected to ``expected_url`` (including any GET data), and the subsequent
+ page was received with ``target_status_code``.
``assertTemplateUsed(response, template_name)``
Asserts that the template with the given name was used in rendering the