def test_HTTPChannelCanUnregisterWithNoProducer(self):
        """
        If there is no producer, the L{HTTPChannel} can still have
        C{unregisterProducer} called.
        """
        channel, transport = self.buildChannelAndTransport(
            StringTransport(), DummyHTTPHandler
        )

        channel.unregisterProducer()
        self.assertIs(channel._requestProducer, None)

        If there is no producer, the L{HTTPChannel} can still have
        C{unregisterProducer} called.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py