Skip to content

Commit ef080e4

Browse files
committed
Minor fix to allow for count=0 in assertContains.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 7cc2bf2 commit ef080e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django/test/testcases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def assertContains(self, response, text, count=None, status_code=200):
8484
"Couldn't retrieve page: Response code was %d (expected %d)'" %
8585
(response.status_code, status_code))
8686
real_count = response.content.count(text)
87-
if count:
87+
if count is not None:
8888
self.assertEqual(real_count, count,
8989
"Found %d instances of '%s' in response (expected %d)" % (real_count, text, count))
9090
else:

0 commit comments

Comments
 (0)