summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index 3ad1979af4..c7604f131e 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -28,6 +28,7 @@ from django.middleware.csrf import CsrfViewMiddleware
from django.template import Template
from django.template.response import TemplateResponse
from django.test import TestCase, TransactionTestCase, RequestFactory, override_settings
+from django.test.signals import setting_changed
from django.test.utils import IgnoreDeprecationWarningsMixin
from django.utils import six
from django.utils import timezone
@@ -1144,8 +1145,12 @@ class FileBasedCacheTests(BaseCacheTests, TestCase):
def setUp(self):
super(FileBasedCacheTests, self).setUp()
self.dirname = tempfile.mkdtemp()
+ # Caches location cannot be modified through override_settings / modify_settings,
+ # hence settings are manipulated directly here and the setting_changed signal
+ # is triggered manually.
for cache_params in settings.CACHES.values():
cache_params.update({'LOCATION': self.dirname})
+ setting_changed.send(self.__class__, setting='CACHES', enter=False)
def tearDown(self):
super(FileBasedCacheTests, self).tearDown()