MCPcopy
hub / github.com/django/django / test_get_or_set_callable

Method test_get_or_set_callable

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

Source from the content-addressed store, hash-verified

281 self.assertIsNone(cache.get_or_set("mykey", None))
282
283 def test_get_or_set_callable(self):
284 def my_callable():
285 return "default"
286
287 self.assertEqual(cache.get_or_set("mykey", my_callable), "default")
288 self.assertEqual(cache.get_or_set("mykey", my_callable()), "default")
289
290
291def custom_key_func(key, key_prefix, version):

Callers

nothing calls this directly

Calls 1

get_or_setMethod · 0.80

Tested by

no test coverage detected