本文整理匯總了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)