From d591fb60bb69af3cabb3eeb84b467d26d5f13dba Mon Sep 17 00:00:00 2001 From: Bertrand Bordage Date: Sun, 7 Dec 2014 04:54:10 +0100 Subject: [PATCH] Fixes the "random number of queries" issue sometimes occuring with locmem. --- settings.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/settings.py b/settings.py index b8f6f6406..9ef2482a2 100644 --- a/settings.py +++ b/settings.py @@ -37,6 +37,12 @@ CACHES = { 'locmem': { 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + 'OPTIONS': { + # We want that limit to be infinite, otherwise we can’t + # reliably count the number of SQL queries executed in tests. + # In this context, 10e9 is enough to be considered infinite. + 'MAX_ENTRIES': 10e9, + } }, 'redis': { 'BACKEND': 'redis_cache.cache.RedisCache',