'I{start_response} returns the I{write} callable which can be used to
write bytes to the response body without buffering.'

def test_write(self):

    channel = DummyChannel()
    intermediateValues = []
    def record():
        intermediateValues.append(channel.transport.written.getvalue())
    def applicationFactory():
        def application(environ, startResponse):
            write = startResponse('100    Foo', [('content-length', '6')])
            write('foo')
            record()
            write('bar')
            record()
            return iter(())
        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
