Fixed #16162. Added timeout arg to `DummyCache.set_many`, for compatiblity with other caches. Thanks to aaugustin for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor 2011-09-10 17:09:23 +00:00
parent b557810207
commit 67dde2f52f
2 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class DummyCache(BaseCache):
self.validate_key(key) self.validate_key(key)
return False return False
def set_many(self, data, version=None): def set_many(self, data, timeout=0, version=None):
pass pass
def delete_many(self, keys, version=None): def delete_many(self, keys, version=None):

View File

@ -147,6 +147,7 @@ class DummyCacheTests(unittest.TestCase):
def test_set_many(self): def test_set_many(self):
"set_many does nothing for the dummy cache backend" "set_many does nothing for the dummy cache backend"
self.cache.set_many({'a': 1, 'b': 2}) self.cache.set_many({'a': 1, 'b': 2})
self.cache.set_many({'a': 1, 'b': 2}, timeout=2, version='1')
def test_delete_many(self): def test_delete_many(self):
"delete_many does nothing for the dummy cache backend" "delete_many does nothing for the dummy cache backend"