diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-07-26 03:58:31 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-07-26 03:58:31 +0000 |
| commit | 6f16b5bad2f714b88639ebb90d30fd6cef686cfc (patch) | |
| tree | c68478fcad80be0388e6512fae263f49dda5c38a /tests/regressiontests/cache | |
| parent | f49c5c23f96f11a993036fa10c81b4287327d7ec (diff) | |
Fixed #7967 -- Make sure the __contains__ method in the cache backends call the
right has_key() method for the subclass. Patch from Marty Alchin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8084 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/cache')
| -rw-r--r-- | tests/regressiontests/cache/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py index f050348c77..703fbe5534 100644 --- a/tests/regressiontests/cache/tests.py +++ b/tests/regressiontests/cache/tests.py @@ -56,11 +56,15 @@ class Cache(unittest.TestCase): cache.set("hello1", "goodbye1") self.assertEqual(cache.has_key("hello1"), True) self.assertEqual(cache.has_key("goodbye1"), False) + cache.set("empty", 'fred') + self.assertEqual(cache.has_key("empty"), True) def test_in(self): cache.set("hello2", "goodbye2") self.assertEqual("hello2" in cache, True) self.assertEqual("goodbye2" in cache, False) + cache.set("empty", 'fred') + self.assertEqual("empty" in cache, True) def test_data_types(self): stuff = { |
