You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

prices_tests.py 517B

123456789101112131415161718
  1. from decimal import Decimal as D
  2. from django.test import TestCase
  3. from oscar.core.prices import Price
  4. class TestPriceObject(TestCase):
  5. def test_can_be_instantiated_with_tax_amount(self):
  6. price = Price('USD', D('10.00'), tax=D('2.00'))
  7. self.assertTrue(price.is_tax_known)
  8. self.assertEqual(D('12.00'), price.incl_tax)
  9. def test_can_have_tax_set_later(self):
  10. price = Price('USD', D('10.00'))
  11. price.tax = D('2.00')
  12. self.assertEqual(D('12.00'), price.incl_tax)