def test_shipping_get_ajax_label(shipping_zone): shipping_method = shipping_zone.shipping_methods.get() label = shipping_method.get_ajax_label() proper_label = '%(shipping_method)s %(price)s' % { 'shipping_method': shipping_method, 'price': format_money(shipping_method.price)} assert label == proper_label
def test_shipping_get_ajax_label(shipping_zone): shipping_method = shipping_zone.shipping_methods.get() label = shipping_method.get_ajax_label() proper_label = "%(shipping_method)s %(price)s" % { "shipping_method": shipping_method, "price": format_money(shipping_method.price), } assert label == proper_label
def test_shipping_get_ajax_label(shipping_method): method = shipping_method.price_per_country.get() label = method.get_ajax_label() proper_label = '%(shipping_method)s %(country_code_display)s %(price)s' % { 'shipping_method': method.shipping_method, 'country_code_display': method.get_country_code_display(), 'price': format_money(method.price)} assert label == proper_label
def test_format_money(): money = Money("123.99", "USD") assert format_money(money) == "$123.99"
def test_format_money(): money = Money('123.99', 'USD') assert format_money(money) == '$123.99'