def test_setResponseCodeAndMessage(self):
        """
        L{http.Request.setResponseCode} takes a status code and a message and
        causes them to be used as the response status.
        """
        channel = DummyChannel()
        req = http.Request(channel, False)
        req.setResponseCode(202, b"happily accepted")
        req.write(b'')
        self.assertEqual(
            channel.transport.written.getvalue().splitlines()[0],
            b'(no clientproto yet) 202 happily accepted')

        L{http.Request.setResponseCode} takes a status code and a message and
        causes them to be used as the response status.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py