summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-05-10 15:51:59 +0000
committerBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-05-10 15:51:59 +0000
commit12702bc683273b84624aa8353513ff4962a37d35 (patch)
tree953e788dda26a2cf7d05c993d9b3608ef017123c /docs
parente5ded41f315cafbc64c2f2d7d6a4d20ce5c3615d (diff)
boulder-oracle-sprint: Merged to [5182]
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/testing.txt13
1 files changed, 7 insertions, 6 deletions
diff --git a/docs/testing.txt b/docs/testing.txt
index ba13dab67e..b44b67c20a 100644
--- a/docs/testing.txt
+++ b/docs/testing.txt
@@ -472,9 +472,9 @@ Normal Python unit tests have a wide range of assertions, such as
``django.TestCase`` adds to these, providing some assertions
that can be useful in testing the behavior of web sites.
-``assertContains(response, text, count=1)``
- Assert that a response indicates that a page was retrieved successfully,
- (i.e., the HTTP status code was 200), and that ``text`` occurs ``count``
+``assertContains(response, text, count=1, status_code=200)``
+ Assert that a response indicates that a page could be retrieved and
+ produced the nominated status code, and that ``text`` occurs ``count``
times in the content of the response.
``assertFormError(response, form, field, errors)``
@@ -493,9 +493,10 @@ that can be useful in testing the behavior of web sites.
Assert that the template with the given name was *not* used in rendering
the response.
-``assertRedirects(response, expected_path)``
- Assert that the response received redirects the browser to the provided
- path, and that the expected_path can be retrieved.
+``assertRedirects(response, expected_path, status_code=302, target_status_code=200)``
+ Assert that the response received produced the nominated status code,
+ redirects the browser to the provided path, and that retrieving the provided
+ path yields a response with the target status code.
``assertTemplateUsed(response, template_name)``
Assert that the template with the given name was used in rendering the