summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-10-19 19:54:23 +0200
committerGitHub <noreply@github.com>2020-10-19 19:54:23 +0200
commit0f182558484ec7964413fc93f6361f0842135b2b (patch)
tree7757e60f9428e1e9f9f7e4beda4d262aa0eed961 /tests/cache
parentb3b0be3df3108afe8522036cda2e589187c49e2e (diff)
downloaddjango-0f182558484ec7964413fc93f6361f0842135b2b.tar.gz
Reverted "Reduced time.sleep() in cache touch() tests."
This reverts commit 177a49e79c882603da64d45995f5fd60dce8c852 which caused more frequent failures of test_touch().
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/tests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index 2a3bf57354..1ef2cc1bc1 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -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)