mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
[1.7.x] Fixed #22495 -- Locmem cache.add() failed with infinite timeouts
cache.add() incorrectly succeeded when there was an existing key
with an infinite (None) timeout.
Backport of af5f688392 from master.
This commit is contained in:
committed by
Claude Paroz
parent
e192f13103
commit
07235aec9d
3
tests/cache/tests.py
vendored
3
tests/cache/tests.py
vendored
@@ -491,6 +491,9 @@ class BaseCacheTests(object):
|
||||
|
||||
cache.add('key2', 'ham', None)
|
||||
self.assertEqual(cache.get('key2'), 'ham')
|
||||
added = cache.add('key1', 'new eggs', None)
|
||||
self.assertEqual(added, False)
|
||||
self.assertEqual(cache.get('key1'), 'eggs')
|
||||
|
||||
cache.set_many({'key3': 'sausage', 'key4': 'lobster bisque'}, None)
|
||||
self.assertEqual(cache.get('key3'), 'sausage')
|
||||
|
||||
Reference in New Issue
Block a user