'Create a request object with a stub channel and install the
passed resource at /newrender. If no resource is passed,
create one.'

def _getReq(self, resource=None):

    d = DummyChannel()
    if (resource is None):
        resource = NewRenderResource()
    d.site.resource.putChild('newrender', resource)
    d.transport.port = 81
    request = server.Request(d, 1)
    request.setHost('example.com', 81)
    request.gotLength(0)
    return request
