def test_HTTPChannelUnregistersSelfWhenCallingLoseConnection(self):
        """
        L{HTTPChannel} unregisters itself when it has loseConnection called.
        """
        channel, transport = self.buildChannelAndTransport(
            StringTransport(), DummyHTTPHandler
        )
        channel.loseConnection()

        self.assertIs(transport.producer, None)
        self.assertIs(transport.streaming, None)

        L{HTTPChannel} unregisters itself when it has loseConnection called.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py