From 0c05c183e414fcf83763ca83f97de873e613c162 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Wed, 3 Nov 2021 08:46:34 +0100 Subject: [PATCH] Refs #33252 -- Used @override_settings in BaseCacheTests.test_cache_write_unpicklable_object() --- tests/cache/tests.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/cache/tests.py b/tests/cache/tests.py index 29e527d4e6..13ff0a45aa 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -994,9 +994,9 @@ class BaseCacheTests: self.assertEqual(caches['custom_key'].get('answer2'), 42) self.assertEqual(caches['custom_key2'].get('answer2'), 42) + @override_settings(CACHE_MIDDLEWARE_ALIAS=DEFAULT_CACHE_ALIAS) def test_cache_write_unpicklable_object(self): fetch_middleware = FetchFromCacheMiddleware(empty_response) - fetch_middleware.cache = cache request = self.factory.get('/cache/test') request._cache_update_cache = True @@ -1011,7 +1011,6 @@ class BaseCacheTests: return response update_middleware = UpdateCacheMiddleware(get_response) - update_middleware.cache = cache response = update_middleware(request) get_cache_data = fetch_middleware.process_request(request)