Only if it is not an OrderedDict > query = sorted(query.items()) > > This would not prevent breakage of unit tests, but it would make a > much simpler fix possible: simply sort the parameters in the URL.