MCPcopy
hub / github.com/django/django / test_delete

Method test_delete

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

Source from the content-addressed store, hash-verified

376 self.assertEqual(cache.get_many(["x", "y"]), {"x": None, "y": 1})
377
378 def test_delete(self):
379 # Cache keys can be deleted
380 cache.set_many({"key1": "spam", "key2": "eggs"})
381 self.assertEqual(cache.get("key1"), "spam")
382 self.assertIs(cache.delete("key1"), True)
383 self.assertIsNone(cache.get("key1"))
384 self.assertEqual(cache.get("key2"), "eggs")
385
386 def test_delete_nonexistent(self):
387 self.assertIs(cache.delete("nonexistent_key"), False)

Callers

nothing calls this directly

Calls 3

set_manyMethod · 0.45
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected