def doLocationTest(self, requestPath: bytes): """ Render a response to a request with path *requestPath* @param requestPath: A slash-separated path like C{b'/foo/bar'}. @returns: The value of the I{Location} header. """ request = Request(DummyChannel(), True) request.method = b"GET" request.prepath = requestPath.lstrip(b"/").split(b"/") resource = ParentRedirect() resource.render(request) [location] = request.responseHeaders.getRawHeaders(b"Location") return location
def render(self, request): self.action() return ParentRedirect.render(self, request)