'L{StringTransport.unregisterProducer} causes the transport to forget
about the registered producer and makes it possible to register a new
one.'

def test_unregisterProducer(self):

    oldProducer = object()
    newProducer = object()
    self.transport.registerProducer(oldProducer, False)
    self.transport.unregisterProducer()
    self.assertIsNone(self.transport.producer)
    self.transport.registerProducer(newProducer, True)
    self.assertIs(self.transport.producer, newProducer)
    self.assertTrue(self.transport.streaming)
