def same(qs): q = QueryDict(qs) assert views.fix_search_query(q) is q
def check(before, after): eq_(views.fix_search_query(QueryDict(before)), dict(urlparse.parse_qsl(after)))