def request_with_middleware(*, response, data): def get_response(request): del request return response m = middleware(get_response) return m(request=RequestFactory().get('/', data=data))
def request_with_middleware(response, request): def get_response(request): del request return response m = middleware(get_response) return m(request=request)