def test_registerProducerTwiceFails(self):
        """
        Calling L{Request.registerProducer} when a producer is already
        registered raises ValueError.
        """
        req = http.Request(DummyChannel(), False)
        req.registerProducer(DummyProducer(), True)
        self.assertRaises(
            ValueError, req.registerProducer, DummyProducer(), True)

        Calling L{Request.registerProducer} when a producer is already
        registered raises ValueError.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py