From ef080e44d054fbabfe47ce51edd1fed78c9e60f4 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 21 Jul 2007 04:36:28 +0000 Subject: [PATCH] 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 --- django/test/testcases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: