def test_encoding(self): expected = "https://{SUBDOMAIN}.recurly.com/subscribe/myplan/mya%C3%A7%C3%A7o+unt/ad%2Fa%C3%A5m?quantity=2&first_name=%C3%85dam&last_name=%C3%87harnock&[email protected]".replace("{SUBDOMAIN}", django_recurly.conf.SUBDOMAIN) self.user.username = u"ad/aåm" self.user.first_name = u"Ådam" self.user.last_name = u"Çharnock" self.user.email = u"*****@*****.**" self.assertEqual(hosted.get_subscribe_url( plan_code=u"myplan", user=self.user, quantity=2, account_code=u"myaçço unt" ), expected)
def test_encoding(self): expected = "https://dummy_subdomain.recurly.com/subscribe/myplan/mya%C3%A7%C3%A7o+unt/ad%2Fa%C3%A5m?quantity=2&first_name=%C3%85dam&last_name=%C3%87harnock&[email protected]" self.user.username = u"ad/aåm" self.user.first_name = u"Ådam" self.user.last_name = u"Çharnock" self.user.email = u"*****@*****.**" self.assertEqual(hosted.get_subscribe_url( plan_code=u"myplan", user=self.user, quantity=2, account_code=u"myaçço unt" ), expected)
def subscribe_url(user, plan_code, quantity=1): return get_subscribe_url(user, plan_code, quantity)