summaryrefslogtreecommitdiff
path: root/tests/cache/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cache/tests.py')
-rw-r--r--tests/cache/tests.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index a01dba46d0..fcce9579d4 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -209,7 +209,7 @@ class DummyCacheTests(SimpleTestCase):
"Iñtërnâtiônàlizætiøn": "Iñtërnâtiônàlizætiøn2",
"ascii2": {"x": 1},
}
- for (key, value) in stuff.items():
+ for key, value in stuff.items():
with self.subTest(key=key):
cache.set(key, value)
self.assertIsNone(cache.get(key))
@@ -514,23 +514,23 @@ class BaseCacheTests:
"ascii2": {"x": 1},
}
# Test `set`
- for (key, value) in stuff.items():
+ for key, value in stuff.items():
with self.subTest(key=key):
cache.set(key, value)
self.assertEqual(cache.get(key), value)
# Test `add`
- for (key, value) in stuff.items():
+ for key, value in stuff.items():
with self.subTest(key=key):
self.assertIs(cache.delete(key), True)
self.assertIs(cache.add(key, value), True)
self.assertEqual(cache.get(key), value)
# Test `set_many`
- for (key, value) in stuff.items():
+ for key, value in stuff.items():
self.assertIs(cache.delete(key), True)
cache.set_many(stuff)
- for (key, value) in stuff.items():
+ for key, value in stuff.items():
with self.subTest(key=key):
self.assertEqual(cache.get(key), value)
@@ -704,6 +704,7 @@ class BaseCacheTests:
portable caching code without making it too difficult to use production
backends with more liberal key rules. Refs #6447.
"""
+
# mimic custom ``make_key`` method being defined since the default will
# never show the below warnings
def func(key, *args):
@@ -802,7 +803,6 @@ class BaseCacheTests:
self.assertIsNone(caches["v2"].get("answer4", version=2))
def test_cache_versioning_add(self):
-
# add, default version = 1, but manually override version = 2
self.assertIs(cache.add("answer1", 42, version=2), True)
self.assertIsNone(cache.get("answer1", version=1))
@@ -1149,7 +1149,6 @@ class BaseCacheTests:
)
)
class DBCacheTests(BaseCacheTests, TransactionTestCase):
-
available_apps = ["cache"]
def setUp(self):
@@ -1468,7 +1467,6 @@ redis_excluded_caches = {"cull", "zero_cull"}
class BaseMemcachedTests(BaseCacheTests):
-
# By default it's assumed that the client doesn't clean up connections
# properly, in which case the backend must do so after each request.
should_disconnect_on_close = True