mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
[1.7.x] Fixed #22606 -- Locmemcache has_key() failed for infinite cache expiry
Refactored cache expiry logic for Locmemcache to make consistent across
all places where accessed, and correctly handle None as expiry time.
Backport of 66880e4cd from master.
This commit is contained in:
committed by
Claude Paroz
parent
31eac71a76
commit
8a090c21f1
2
tests/cache/tests.py
vendored
2
tests/cache/tests.py
vendored
@@ -286,6 +286,8 @@ class BaseCacheTests(object):
|
||||
cache.set("hello1", "goodbye1")
|
||||
self.assertEqual(cache.has_key("hello1"), True)
|
||||
self.assertEqual(cache.has_key("goodbye1"), False)
|
||||
cache.set("no_expiry", "here", None)
|
||||
self.assertEqual(cache.has_key("no_expiry"), True)
|
||||
|
||||
def test_in(self):
|
||||
# The in operator can be used to inspect cache contents
|
||||
|
||||
Reference in New Issue
Block a user