Kaydet (Commit) ef080e44 authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

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
üst 7cc2bf2f
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment