def test_headerKeyMustBeNativeString(self):
        """
        Each header key passed to the I{start_response} callable MUST be at
        native string in Python 2 and Python 3.
        """
        key = b"key" if _PY3 else u"key"

        def application(environ, startResponse):
            startResponse("200 OK", [(key, "value")])
            return iter(())

        request, result = self.prepareRequest(application)
        request.requestReceived()

        def checkMessage(error):
            self.assertEqual(
                "header must be (str, str) tuple, not (%r, 'value')" % (key,),
                str(error))

        return self.assertFailure(result, TypeError).addCallback(checkMessage)

        Each header key passed to the I{start_response} callable MUST be at
        native string in Python 2 and Python 3.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_wsgi.py