MCPcopy
hub / github.com/django/django / test_expiration

Method test_expiration

tests/cache/tests.py:214–225  ·  tests/cache/tests.py::DummyCacheTests.test_expiration

Expiration has no effect on the dummy cache

(self)

Source from the content-addressed store, hash-verified

212 self.assertIsNone(cache.get(key))
213
214 def test_expiration(self):
215 class="st">"Expiration has no effect on the dummy cache"
216 cache.set(class="st">"expire1", class="st">"very quickly", 1)
217 cache.set(class="st">"expire2", class="st">"very quickly", 1)
218 cache.set(class="st">"expire3", class="st">"very quickly", 1)
219
220 time.sleep(2)
221 self.assertIsNone(cache.get(class="st">"expire1"))
222
223 self.assertIs(cache.add(class="st">"expire2", class="st">"newvalue"), True)
224 self.assertIsNone(cache.get(class="st">"expire2"))
225 self.assertIs(cache.has_key(class="st">"expire3"), False)
226
227 def test_unicode(self):
228 class="st">"Unicode values are ignored by the dummy cache"

Callers

nothing calls this directly

Calls 5

sleepMethod · 0.80
setMethod · 0.45
getMethod · 0.45
addMethod · 0.45
has_keyMethod · 0.45

Tested by

no test coverage detected