summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-07-20 14:32:20 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-07-20 14:32:20 +0000
commit56394220d5d4ae443dfc0fb55f677099696a55bf (patch)
treea583ad099af9ca95cee4a0018b8d4b2de51531b5 /docs
parentbdc5a3eb51f42946ef6d56333edaff16caeecb34 (diff)
Fixed #4901 -- Modified assertContains to provide a default check of 'any instances of text in content'. Thanks for the suggestion, nis@superlativ.dk.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5731 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/testing.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/testing.txt b/docs/testing.txt
index 704d224daa..4158e9277a 100644
--- a/docs/testing.txt
+++ b/docs/testing.txt
@@ -481,10 +481,11 @@ 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, status_code=200)``
+``assertContains(response, text, count=None, 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.
+ produced the nominated status code, and that ``text`` in the content
+ of the response. If ``count`` is provided, ``text`` must occur exactly
+ ``count`` times in the response.
``assertFormError(response, form, field, errors)``
Assert that a field on a form raised the provided list of errors when