本文整理汇总了Python中InvoiceGenerator.api.Invoice.rounding_strategy方法的典型用法代码示例。如果您正苦于以下问题:Python Invoice.rounding_strategy方法的具体用法?Python Invoice.rounding_strategy怎么用?Python Invoice.rounding_strategy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InvoiceGenerator.api.Invoice
的用法示例。
在下文中一共展示了Invoice.rounding_strategy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_price_tax_rounding
# 需要导入模块: from InvoiceGenerator.api import Invoice [as 别名]
# 或者: from InvoiceGenerator.api.Invoice import rounding_strategy [as 别名]
def test_price_tax_rounding(self):
"""
Test, that the price that sums up to 1756.5 gets rounded according to rounding strategy.
"""
invoice = Invoice(Client('Foo'), Provider('Bar'), Creator('Blah'))
invoice.add_item(Item(5, 290, tax=21))
invoice.rounding_result = True
invoice.use_tax = True
self.assertEqual(1754, invoice.price_tax)
invoice.rounding_strategy = decimal.ROUND_HALF_UP
self.assertEqual(1755, invoice.price_tax)