MCPcopy
hub / github.com/django/django / test_prefix

Method test_prefix

tests/cache/tests.py:350–360  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

348 self.assertEqual(cache.get("addkey1"), "value")
349
350 def test_prefix(self):
351 # Test for same cache key conflicts between shared backend
352 cache.set("somekey", "value")
353
354 # should not be set in the prefixed cache
355 self.assertIs(caches["prefix"].has_key("somekey"), False)
356
357 caches["prefix"].set("somekey", "value2")
358
359 self.assertEqual(cache.get("somekey"), "value")
360 self.assertEqual(caches["prefix"].get("somekey"), "value2")
361
362 def test_non_existent(self):
363 """Nonexistent cache keys return as None/default."""

Callers

nothing calls this directly

Calls 3

setMethod · 0.45
has_keyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected