'Django must prevent caching of responses that set a user-specific (and
maybe security sensitive) cookie in response to a cookie-less request.'

def test_sensitive_cookie_not_cached(self):

    csrf_middleware = CsrfViewMiddleware()
    cache_middleware = CacheMiddleware()
    request = self.factory.get('/view/')
    self.assertIsNone(cache_middleware.process_request(request))
    csrf_middleware.process_view(request, csrf_view, (), {})
    response = csrf_view(request)
    response = csrf_middleware.process_response(request, response)
    response = cache_middleware.process_response(request, response)
    self.assertIsNone(cache_middleware.process_request(request))
