def test_queryStringIsNativeString(self):
        """
        The C{'QUERY_STRING'} key of the C{environ} C{dict} passed to the
        application is always a native string.
        """
        request, result = self.prepareRequest()
        request.requestReceived(path=b"/res?foo=bar")
        result.addCallback(self.environKeyEqual('QUERY_STRING', 'foo=bar'))
        self.assertIsInstance(self.successResultOf(result), str)

        if _PY3:
            # Native strings are rejected by Request.requestReceived() before
            # t.w.wsgi has any say in the matter.
            request, result = self.prepareRequest()
            self.assertRaises(
                TypeError, request.requestReceived, path=u"/res?foo=bar")
        else:
            request, result = self.prepareRequest()
            request.requestReceived(path=u"/res?foo=bar")
            result.addCallback(self.environKeyEqual('QUERY_STRING', 'foo=bar'))
            self.assertIsInstance(self.successResultOf(result), str)

        The C{'QUERY_STRING'} key of the C{environ} C{dict} passed to the
        application is always a native string.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_wsgi.py