'Process a request using the middleware.'

def _get_response(self, is_secure=True, csrf_cookie_used=True, cross_domain_decorator=True, referer=None, host=None, delete_referer=False):

    request = Mock()
    request.META = {'HTTP_REFERER': (referer if (referer is not None) else self.REFERER)}
    request.is_secure = (lambda : is_secure)
    if (host is not None):
        request.get_host = (lambda : host)
    if delete_referer:
        del request.META['HTTP_REFERER']
    if csrf_cookie_used:
        request.META['CSRF_COOKIE_USED'] = True
        request.META['CSRF_COOKIE'] = self.COOKIE_VALUE
    if cross_domain_decorator:
        request.META['CROSS_DOMAIN_CSRF_COOKIE_USED'] = True
    return self.middleware.process_response(request, HttpResponse())
