MCPcopy
hub / github.com/django/django / test_non_existent

Method test_non_existent

tests/cache/tests.py:362–365  ·  view source on GitHub ↗

Nonexistent cache keys return as None/default.

(self)

Source from the content-addressed store, hash-verified

360 self.assertEqual(caches["prefix"].get("somekey"), "value2")
361
362 def test_non_existent(self):
363 """Nonexistent cache keys return as None/default."""
364 self.assertIsNone(cache.get("does_not_exist"))
365 self.assertEqual(cache.get("does_not_exist", "bang!"), "bang!")
366
367 def test_get_many(self):
368 # Multiple cache keys can be returned using get_many

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected