MCPcopy
hub / github.com/django/django / test_get_or_set

Method test_get_or_set

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

Source from the content-addressed store, hash-verified

1127 cache.set("unpicklable", Unpicklable())
1128
1129 def test_get_or_set(self):
1130 self.assertIsNone(cache.get("projector"))
1131 self.assertEqual(cache.get_or_set("projector", 42), 42)
1132 self.assertEqual(cache.get("projector"), 42)
1133 self.assertIsNone(cache.get_or_set("null", None))
1134 # Previous get_or_set() stores None in the cache.
1135 self.assertIsNone(cache.get("null", "default"))
1136
1137 def test_get_or_set_callable(self):
1138 def my_callable():

Callers

nothing calls this directly

Calls 2

get_or_setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected