Exemple #1
0
    def test_get_customer_tax_rate(self):
        self.customer.selected_shipping_address.country = self.us
        self.customer.selected_shipping_address.save()
        result = get_customer_tax_rate(self.request, self.product)
        self.assertEqual(result, 20.0)

        self.customer.selected_shipping_address.country = self.ch
        self.customer.selected_shipping_address.save()
        result = get_customer_tax_rate(self.request, self.product)
        self.assertEqual(result, 20.0)

        self.customer.selected_shipping_address.country = self.ie
        self.customer.selected_shipping_address.save()
        result = get_customer_tax_rate(self.request, self.product)
        self.assertEqual(result, 10.0)

        self.customer.selected_shipping_address.country = self.de
        self.customer.selected_shipping_address.save()
        result = get_customer_tax_rate(self.request, self.product)
        self.assertEqual(result, 0.0)
Exemple #2
0
    def test_get_customer_tax_rate(self):
        self.customer.selected_shipping_address.country = self.us
        self.customer.selected_shipping_address.save()
        result = get_customer_tax_rate(self.request, self.product)
        self.assertEqual(result, 20.0)

        self.customer.selected_shipping_address.country = self.ch
        self.customer.selected_shipping_address.save()
        result = get_customer_tax_rate(self.request, self.product)
        self.assertEqual(result, 20.0)

        self.customer.selected_shipping_address.country = self.ie
        self.customer.selected_shipping_address.save()
        result = get_customer_tax_rate(self.request, self.product)
        self.assertEqual(result, 10.0)

        self.customer.selected_shipping_address.country = self.de
        self.customer.selected_shipping_address.save()
        result = get_customer_tax_rate(self.request, self.product)
        self.assertEqual(result, 0.0)
Exemple #3
0
 def get_customer_tax_rate(self):
     """
     Returns the tax rate for the current customer and product.
     """
     from muecke.customer_tax.utils import get_customer_tax_rate
     return get_customer_tax_rate(self.request, self.product)