MCPcopy
hub / github.com/django/django / test_incr_decr_timeout

Method test_incr_decr_timeout

tests/cache/tests.py:1501–1512  ·  view source on GitHub ↗

incr/decr does not modify expiry time (matches memcached behavior)

(self)

Source from the content-addressed store, hash-verified

1499 self.assertFalse(bad_obj.locked, "Cache was locked during pickling")
1500
1501 def test_incr_decr_timeout(self):
1502 """
1503 incr/decr does not modify expiry time (matches memcached behavior)
1504 """
1505 key = "value"
1506 _key = cache.make_key(key)
1507 cache.set(key, 1, timeout=cache.default_timeout * 10)
1508 expire = cache._expire_info[_key]
1509 self.assertEqual(cache.incr(key), 2)
1510 self.assertEqual(expire, cache._expire_info[_key])
1511 self.assertEqual(cache.decr(key), 1)
1512 self.assertEqual(expire, cache._expire_info[_key])
1513
1514 @retry()
1515 @limit_locmem_entries

Callers

nothing calls this directly

Calls 4

make_keyMethod · 0.80
decrMethod · 0.80
setMethod · 0.45
incrMethod · 0.45

Tested by

no test coverage detected