diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-21 04:36:28 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-21 04:36:28 +0000 |
| commit | ef080e44d054fbabfe47ce51edd1fed78c9e60f4 (patch) | |
| tree | b505dad45f8ab4246b220f1656c2e9748545eb76 | |
| parent | 7cc2bf2f030940f0acd7b6ad0c56f2d60122fb34 (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.py | 2 |
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: |
