title: How to overwrite django CACHE settings in tests
body: <p>I'm using <code>django.core.cache.backends.dummy.DummyCache</code> in my tests, however, there is one test which requires actual caching so I want to overwrite the CACHE setting for this one particular test. I want to test calling a <a href="http://www.django-rest-framework.org/" rel="noreferrer">DRF</a> view within a url which make use of <a href="https://docs.djangoproject.com/en/1.9/topics/cache/#specifying-per-view-cache-in-the-urlconf" rel="noreferrer">cache_page</a> url configuration.</p>
  
  <p>To archive this in my test I use the <code>@override_settings</code> like this: <code>@override_settings(CACHES={'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}})</code>.
  This works fine if I only run this test. But now some other tests are failing. In the <a href="https://docs.djangoproject.com/en/1.8/topics/testing/tools/#django.test.modify_settings" rel="noreferrer">django docs</a> </p>
  
  <p>I found a warning which says:</p>
  
  <blockquote>
    <p>Altering the CACHES setting is possible, but a bit tricky if you are using internals that make using of caching, like django.contrib.sessions. For example, you will have to reinitialize the session backend in a test that uses cached sessions and overrides CACHES.</p>
  </blockquote>
  
  <p>So I assume I have to reinitialize the middleware-stack or the urlconf somehow. But I'm not sure and get stuck at this point.</p>