def test_show_empty_string_when_value_is_none_and_show_zero_is_False(self): amount = formatting_tags.format_currency(None, show_zero="False") self.assertEqual("", amount)
def test_show_zero_when_value_is_none_and_show_zero_is_True(self): amount = formatting_tags.format_currency(None, show_zero="True") self.assertEqual("$0.00", amount)
def test_add_thousand_separator(self): amount = formatting_tags.format_currency(1000) self.assertEqual("$1,000.00", amount)
def test_allow_decimal_precision_to_be_specified(self): amount = formatting_tags.format_currency(123.123456, 4) self.assertEqual("$123.1235", amount)
def test_show_default_formatted_dollar_amount_when_amount_is_not_zero(self): amount = formatting_tags.format_currency(123) self.assertEqual("$123.00", amount)
def test_show_formatted_zero_amount(self): amount = formatting_tags.format_currency(0) self.assertEqual("$0.00", amount)
def test_show_empty_string_when_amount_is_zero_if_show_zero_is_false(self): amount = formatting_tags.format_currency(0, show_zero="False") self.assertEqual("", amount)