Parse query string in test

This allows for a more precise test; Py2 and Py3 apparently
construct URL fragments in different orders, so string-comparing
them can cause your test to fail. Parsing them into dicts avoids this