MCPcopy
hub / github.com/django/django / test_has_key

Method test_has_key

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

Source from the content-addressed store, hash-verified

387 self.assertIs(cache.delete("nonexistent_key"), False)
388
389 def test_has_key(self):
390 # The cache can be inspected for cache keys
391 cache.set("hello1", "goodbye1")
392 self.assertIs(cache.has_key("hello1"), True)
393 self.assertIs(cache.has_key("goodbye1"), False)
394 cache.set("no_expiry", "here", None)
395 self.assertIs(cache.has_key("no_expiry"), True)
396 cache.set("null", None)
397 self.assertIs(cache.has_key("null"), True)
398
399 def test_in(self):
400 # The in operator can be used to inspect cache contents

Callers

nothing calls this directly

Calls 2

setMethod · 0.45
has_keyMethod · 0.45

Tested by

no test coverage detected