'The C{\'QUERY_STRING\'} key of the C{environ} C{dict} passed to the
application is always a native string.'

def test_queryStringIsNativeString(self):

    (request, result) = self.prepareRequest()
    request.requestReceived(path='/res?foo=bar')
    result.addCallback(self.environKeyEqual('QUERY_STRING', 'foo=bar'))
    self.assertIsInstance(self.successResultOf(result), str)
    if _PY3:
        (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)
