'Strings produced by the iterator returned by the application object are
written to the request in the reactor thread.'

def test_iteratedValuesWrittenFromThread(self):

    self.enableThreads()
    invoked = []
    class ThreadVerifier(Request, ):
        def write(self, bytes):
            invoked.append(getThreadID())
            return Request.write(self, bytes)
    def applicationFactory():
        def application(environ, startResponse):
            startResponse('200    OK', [])
            (yield 'foo')
        return application
    (d, requestFactory) = self.requestFactoryFactory(ThreadVerifier)
    def cbRendered(ignored):
        self.assertEqual(set(invoked), set([getThreadID()]))
    d.addCallback(cbRendered)
    self.lowLevelRender(requestFactory, applicationFactory, DummyChannel, 'GET', '1.1', [], [''])
    return d
