'Anonymous requests are allowed if a L{Portal} has an anonymous checker
registered.'

def test_anonymousAccess(self):

    unprotectedContents = 'contents    of    the    unprotected    child    resource'
    self.avatars[ANONYMOUS] = Resource()
    self.avatars[ANONYMOUS].putChild(self.childName, Data(unprotectedContents, 'text/plain'))
    self.portal.registerChecker(AllowAnonymousAccess())
    self.credentialFactories.append(BasicCredentialFactory('example.com'))
    request = self.makeRequest([self.childName])
    child = getChildForRequest(self.wrapper, request)
    d = request.notifyFinish()
    def cbFinished(ignored):
        self.assertEqual(request.written, [unprotectedContents])
    d.addCallback(cbFinished)
    request.render(child)
    return d
