MCPcopy
hub / github.com/django/django / test_default_used_when_none_is_set

Method test_default_used_when_none_is_set

tests/cache/tests.py:339–342  ·  tests/cache/tests.py::BaseCacheTests.test_default_used_when_none_is_set

If None is cached, get() returns it instead of the default.

(self)

Source from the content-addressed store, hash-verified

337 self.assertEqual(cache.get(class="st">"key"), class="st">"value")
338
339 def test_default_used_when_none_is_set(self):
340 class="st">""class="st">"If None is cached, get() returns it instead of the default."class="st">""
341 cache.set(class="st">"key_default_none", None)
342 self.assertIsNone(cache.get(class="st">"key_default_none", default=class="st">"default"))
343
344 def test_add(self):
345 class="cm"># A key can be added to a cache

Callers

nothing calls this directly

Calls 2

setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected