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
This commit is contained in:
Russell Keith-Magee 2007-07-21 04:36:28 +00:00
parent 7cc2bf2f03
commit ef080e44d0
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ class TestCase(unittest.TestCase):
"Couldn't retrieve page: Response code was %d (expected %d)'" %
(response.status_code, status_code))
real_count = response.content.count(text)
if count:
if count is not None:
self.assertEqual(real_count, count,
"Found %d instances of '%s' in response (expected %d)" % (real_count, text, count))
else: