Commit 86f41d73 authored by Sean Bleier's avatar Sean Bleier

Merge pull request #102 from paksu/fix_set_many_versioning

Bugfix: set_many does not set key version
parents 2208beac 37c8ec5a
......@@ -60,7 +60,7 @@ class RedisCache(BaseRedisCache):
If timeout is given, that timeout will be used for the key; otherwise
the default cache timeout will be used.
"""
versioned_keys = self.make_keys(data.keys())
versioned_keys = self.make_keys(data.keys(), version=version)
if timeout is None:
new_data = {}
for key in versioned_keys:
......
......@@ -349,6 +349,11 @@ class BaseRedisTestCase(SetupMixin):
self.assertIsNone(self.cache.get("key1"))
self.assertIsNone(self.cache.get("key2"))
def test_set_many_version(self):
self.cache.set_many({"key1": "spam", "key2": "eggs"}, version=2)
self.assertEqual(self.cache.get("key1", version=2), "spam")
self.assertEqual(self.cache.get("key2", version=2), "eggs")
def test_delete_many(self):
# Multiple keys can be deleted using delete_many
self.cache.set("key1", "spam")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment