'Content produced by the iterator returned by the application object is
written to the request as it is produced.'

def test_content(self):

    channel = DummyChannel()
    intermediateValues = []
    def record():
        intermediateValues.append(channel.transport.written.getvalue())
    def applicationFactory():
        def application(environ, startResponse):
            startResponse('200    OK', [('content-length', '6')])
            (yield 'foo')
            record()
            (yield 'bar')
            record()
        return application
    (d, requestFactory) = self.requestFactoryFactory()
    def cbRendered(ignored):
        self.assertEqual(self.getContentFromResponse(intermediateValues[0]), 'foo')
        self.assertEqual(self.getContentFromResponse(intermediateValues[1]), 'foobar')
    d.addCallback(cbRendered)
    self.lowLevelRender(requestFactory, applicationFactory, (lambda : channel), 'GET', '1.1', [], [''], None, [])
    return d
