def test_notAllowedMethod(self):
        """
        When trying to invoke a method not in the allowed method list, we get
        a response saying it is not allowed.
        """
        req = self._getReq()
        req.requestReceived(b'POST', b'/newrender', b'HTTP/1.0')
        self.assertEqual(req.code, 405)
        self.assertTrue(req.responseHeaders.hasHeader(b"allow"))
        raw_header = req.responseHeaders.getRawHeaders(b'allow')[0]
        allowed = sorted([h.strip() for h in raw_header.split(b",")])
        self.assertEqual([b'GET', b'HEAD', b'HEH'], allowed)

        When trying to invoke a method not in the allowed method list, we get
        a response saying it is not allowed.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_web.py