1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

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

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: