mirror of https://github.com/django/django.git
Reverted "Reduced time.sleep() in cache touch() tests."
This reverts commit 177a49e79c
which caused more frequent failures of test_touch().
This commit is contained in:
parent
b3b0be3df3
commit
0f18255848
|
@ -440,15 +440,15 @@ class BaseCacheTests:
|
|||
def test_touch(self):
|
||||
# cache.touch() updates the timeout.
|
||||
cache.set('expire1', 'very quickly', timeout=1)
|
||||
self.assertIs(cache.touch('expire1', timeout=2), True)
|
||||
time.sleep(1.0)
|
||||
self.assertIs(cache.touch('expire1', timeout=4), True)
|
||||
time.sleep(2)
|
||||
self.assertIs(cache.has_key('expire1'), True)
|
||||
time.sleep(1.5)
|
||||
time.sleep(3)
|
||||
self.assertIs(cache.has_key('expire1'), False)
|
||||
# cache.touch() works without the timeout argument.
|
||||
cache.set('expire1', 'very quickly', timeout=1)
|
||||
self.assertIs(cache.touch('expire1'), True)
|
||||
time.sleep(1.5)
|
||||
time.sleep(2)
|
||||
self.assertIs(cache.has_key('expire1'), True)
|
||||
|
||||
self.assertIs(cache.touch('nonexistent'), False)
|
||||
|
|
Loading…
Reference in New Issue