url2 = 'http://google.com/?b=2&a=1'

def parse_url(url):
    u = urlparse.urlparse(url)
q = u.query
u = urlparse.urlparse(u.geturl().replace(q, ''))
return u, urlparse.parse_qs(q)
parse_url(url1)

def assert_url_equals(url1, url2):
    return parse_url(url1) == parse_url(url1)
assert_url_equals(url1, url2)
Looking for assertURLEquals