From ea901eb9ad951b551ef28ab6c68296ca5888a1cb Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 30 Oct 2017 15:25:33 +0000 Subject: [PATCH] [2.0.x] Refs #27318 -- Made DummyCache.set_many() return a list for consistency with other backends. Backport of abacd09f07f4bb0aa1a3a32bc6e3c3570fa76912 from master --- django/core/cache/backends/dummy.py | 2 +- tests/cache/tests.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django/core/cache/backends/dummy.py b/django/core/cache/backends/dummy.py index d1aea0a325f..7957df80724 100644 --- a/django/core/cache/backends/dummy.py +++ b/django/core/cache/backends/dummy.py @@ -34,7 +34,7 @@ class DummyCache(BaseCache): return False def set_many(self, data, timeout=DEFAULT_TIMEOUT, version=None): - pass + return [] def delete_many(self, keys, version=None): pass diff --git a/tests/cache/tests.py b/tests/cache/tests.py index 0549d790bc8..25dff7ec7fa 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -175,8 +175,8 @@ class DummyCacheTests(SimpleTestCase): def test_set_many(self): "set_many does nothing for the dummy cache backend" - cache.set_many({'a': 1, 'b': 2}) - cache.set_many({'a': 1, 'b': 2}, timeout=2, version='1') + self.assertEqual(cache.set_many({'a': 1, 'b': 2}), []) + self.assertEqual(cache.set_many({'a': 1, 'b': 2}, timeout=2, version='1'), []) def test_delete_many(self): "delete_many does nothing for the dummy cache backend"