'The resource rendered for forbidden requests is stored as a class
member so that users can customize it.'

def test_forbiddenResource_customize(self):

    base = FilePath(self.mktemp())
    base.setContent('')
    markerResponse = 'custom-forbidden-response'
    def failingOpenForReading():
        raise IOError(errno.EACCES, '')
    class CustomForbiddenResource(resource.Resource, ):
        def render(self, request):
            return markerResponse
    class CustomStaticFile(static.File, ):
        forbidden = CustomForbiddenResource()
    fileResource = CustomStaticFile(base.path)
    fileResource.openForReading = failingOpenForReading
    request = DummyRequest([''])
    result = fileResource.render(request)
    self.assertEqual(markerResponse, result)
