def test_no_quote(self): u = URL(u'/урл/', host=u'сайт.рф', query={'q': u'поиск'}, fragment=u"якорь") self.assertEqual(u.get_readable(), u'http://сайт.рф/урл/?q=поиск#якорь')
def test_quotted_path_to_constructor(self): u = URL(u'/%D1%83/', host=u'xn--80aswg.xn--p1ai', query={'q': u'%D0%BF'}, fragment=u"%D1%8F") # We shold not try to unquote the urlqouted values! # Otherwise it is impossible to build a consistent interface self.assertEqual(u, u'http://xn--80aswg.xn--p1ai/%25D1%2583/?q=%25D0%25BF#%25D1%258F') self.assertEqual(u.get_readable(), u'http://сайт.рф/%25D1%2583/?q=%25D0%25BF#%25D1%258F')
def test_no_quote(self): u = URL(u'/урл/', host=u'сайт.рф', query={'q': u'поиск'}) self.assertEqual(u.get_readable(), u'http://сайт.рф/урл/?q=поиск')