'Resource traversal which terminates at an L{HTTPAuthSessionWrapper}
and includes correct authentication headers results in the
L{IResource} avatar (not one of its children) retrieved from the
portal being rendered.'

def test_renderAuthorized(self):

    self.credentialFactories.append(BasicCredentialFactory('example.com'))
    request = self.makeRequest([])
    child = self._authorizedBasicLogin(request)
    d = request.notifyFinish()
    def cbFinished(ignored):
        self.assertEqual(request.written, [self.avatarContent])
    d.addCallback(cbFinished)
    request.render(child)
    return d
