'If a producer is registered after the transport has disconnected, the
producer is not used, and its stopProducing method is called.'

def registerProducerAfterConnectionLost(self, streaming):

    (clientProtocol, tlsProtocol) = buildTLSProtocol()
    clientProtocol.connectionLost = (lambda reason: reason.trap(Error, ConnectionLost))
    class Producer(object, ):
        stopped = False
        def resumeProducing(self):
            return (1 / 0)
        def stopProducing(self):
            self.stopped = True
    tlsProtocol.connectionLost(Failure(ConnectionDone()))
    producer = Producer()
    tlsProtocol.registerProducer(producer, False)
    self.assertIsNone(tlsProtocol.transport.producer)
    self.assertTrue(producer.stopped)
