Пример #1
0
    def test_order_taxes(self):
        order = Order('13 music CD at 14.99')
        price = Decimal('14.99')
        tax = rounding_rule(price * Decimal('0.1'))

        self.assertEqual(tax, order.tax())
        self.assertEqual(price + tax, order.taxed_price())
Пример #2
0
    def test_order_free_imported(self):
        order = Order('13 imported book at 10.00')
        price = Decimal('10.00')
        tax = rounding_rule(price * Decimal('0.05'))

        self.assertEqual(tax, order.tax())
Пример #3
0
    def test_order_imported_and_taxed(self):
        order = Order('1 imported bottle of perfume at 10.00')
        price = Decimal('10.00')
        tax = rounding_rule(price*Decimal('0.05') + price*Decimal('0.10'))

        self.assertEqual(tax, order.tax())
Пример #4
0
 def test_order_free(self):
     order = Order('13 book at 14.99')
     self.assertEqual(Decimal('0.00'), order.tax())