'The C{\'QUERY_STRING\'} key of the C{environ} C{dict} passed to the
application contains the portion of the request URI after the first
I{?} (RFC 3875, section 4.1.7).'

def test_queryString(self):

    missing = self.render('GET', '1.1', [], [''], None)
    missing.addCallback(self.environKeyEqual('QUERY_STRING', ''))
    empty = self.render('GET', '1.1', [], [''], [])
    empty.addCallback(self.environKeyEqual('QUERY_STRING', ''))
    present = self.render('GET', '1.1', [], [''], [('foo', 'bar')])
    present.addCallback(self.environKeyEqual('QUERY_STRING', 'foo=bar'))
    unencoded = self.render('GET', '1.1', [], [''], [('/', '/')])
    unencoded.addCallback(self.environKeyEqual('QUERY_STRING', '%2F=%2F'))
    doubleQuestion = self.render('GET', '1.1', [], [''], [('foo', '?bar')], safe='?')
    doubleQuestion.addCallback(self.environKeyEqual('QUERY_STRING', 'foo=?bar'))
    return gatherResults([missing, empty, present, unencoded, doubleQuestion])
