summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-07-21 04:36:28 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-07-21 04:36:28 +0000
commitef080e44d054fbabfe47ce51edd1fed78c9e60f4 (patch)
treeb505dad45f8ab4246b220f1656c2e9748545eb76
parent7cc2bf2f030940f0acd7b6ad0c56f2d60122fb34 (diff)
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
-rw-r--r--django/test/testcases.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index df583b3ce3..5373d822df 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -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: