I'm using Django DummyCache
in my tests, however, there are a few tests which relay on real caching so using fake caching is not good here.
Is there a clean way to override the general Django settings
for a certain module or scope? Preferably using a Python decorator
.
I'm using Django
version 1.8.4
.
Take a look at https://docs.djangoproject.com/en/1.8/topics/testing/tools/#overriding-settings
You can use decorator override_settings
from django.test import TestCase, override_settings
class MyTestCase(TestCase):
@override_settings(CACHES=...)
def test_something(self):
....