def METHOD_NAME(monkeypatch, kwargs, base, url_root):
    monkeypatch.setattr(Response, "autocorrect_location_header", True)
    @Request.application
    def app(request):
        # for header
        assert request.remote_addr == "192.168.0.1"
        # proto, host, port, prefix headers
        assert request.url_root == url_root
        urls = url_map.bind_to_environ(request.environ)
        parrot_url = urls.build("parrot")
        # build includes prefix
        assert urls.build("parrot") == "/".join((request.script_root, "parrot"))
        # match doesn't include prefix
        assert urls.match("/parrot")[0] == "parrot"
        # With autocorrect_location_header enabled, location header will
        # start with url_root
        return redirect(parrot_url)
    url_map = Map([Rule("/parrot", endpoint="parrot")])
    app = ProxyFix(app, **kwargs)
    base.setdefault("REMOTE_ADDR", "192.168.0.1")
    environ = create_environ(environ_overrides=base)
    # host is always added, remove it if the test doesn't set it
    if "HTTP_HOST" not in base:
        del environ["HTTP_HOST"]
    response = Client(app).open(Request(environ))
    assert response.location == f"{url_root}parrot"