def METHOD_NAME(self, user_agent, cache_get_many_calls_for_request=1):
    """ Helper function that makes calls to middle process_request and process_response """
    fake_request = HttpRequest()
    fake_request.META['HTTP_USER_AGENT'] = user_agent
    with mock.patch.object(caches['default'], 'get_many', wraps=caches['default'].get_many) as mocked_code:
        request_response = self.middleware.process_request(fake_request)
        assert cache_get_many_calls_for_request == mocked_code.call_count
    with mock.patch.object(caches['default'], 'get_many', wraps=caches['default'].get_many) as mocked_code:
        processed_response = self.middleware.process_response(fake_request, request_response or HttpResponse())
        assert 0 == mocked_code.call_count
    return request_response, processed_response