예제 #1
0
    def test_applies_correctly_to_shipping_method_without_tax(self):
        add_product(self.basket, D('12.00'), 3)

        # Apply offers to basket
        utils.Applicator().apply_offers(self.basket, [self.offer])

        repo = repository.Repository()
        raw_method = ExcludingTax()
        method = repo.prime_method(self.basket, raw_method)
        self.assertEqual(D('5.00'), method.charge_excl_tax)
예제 #2
0
    def test_applies_correctly_to_shipping_method_with_tax(self):
        add_product(self.basket, D('12.00'), 3)

        # Apply offers to basket
        utils.Applicator().apply_offers(self.basket, [self.offer])

        repo = repository.Repository()
        raw_method = IncludingTax()
        method = repo.apply_shipping_offer(self.basket, raw_method, self.offer)
        charge = method.calculate(self.basket)
        self.assertEqual(D('6.00'), charge.incl_tax)
        self.assertEqual(D('5.00'), charge.excl_tax)
예제 #3
0
 def setUp(self):
     self.repo = repository.Repository()
예제 #4
0
 def setUp(self):
     self.repo = repository.Repository()
     self.basket = Basket()