From 1124e163403a1d474016cfc3cf9173eb44349e34 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 23 Nov 2013 16:49:14 +0100 Subject: [PATCH] Allowed running the test suite without memcached (!) --- tests/cache/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cache/tests.py b/tests/cache/tests.py index 4ebcd078de..c416ae6c2d 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -1012,13 +1012,13 @@ class LocMemCacheTests(BaseCacheTests, TestCase): # To check the memcached backend, the test settings file will # need to contain at least one cache backend setting that points at # your memcache server. -memcached_params = None +memcached_params = {} for _cache_params in settings.CACHES.values(): if _cache_params['BACKEND'].startswith('django.core.cache.backends.memcached.'): memcached_params = _cache_params -@unittest.skipIf(memcached_params is None, "memcached not available") +@unittest.skipUnless(memcached_params, "memcached not available") @override_settings(CACHES=caches_setting_for_tests(**memcached_params)) class MemcachedCacheTests(BaseCacheTests, TestCase):