Exemplo n.º 1
0
 def test_simple_shipping(self):
     # Product.is_shippable should be True unless the Product has a subtype
     # where is_shippable == False
     subtype1 = ConfigurableProduct.objects.create(product=self.product1)
     self.assertTrue(getattr(subtype1, "is_shippable", True))
     self.assertTrue(self.cartitem1.is_shippable)
     self.assertTrue(self.product1.is_shippable)
     self.assertTrue(self.cart1.is_shippable)
     self.assertEqual(flat(self.cart1, None).cost(), Decimal("4.00"))
     self.assertEqual(per(self.cart1, None).cost(), Decimal("12.00"))
Exemplo n.º 2
0
 def test_simple_shipping(self):
     # Product.is_shippable should be True unless the Product has a subtype
     # where is_shippable == False
     subtype1 = ConfigurableProduct.objects.create(product=self.product1)
     self.assert_(getattr(subtype1, 'is_shippable', True))
     self.assert_(self.cartitem1.is_shippable)
     self.assert_(self.product1.is_shippable)
     self.assert_(self.cart1.is_shippable)
     self.assertEqual(flat(self.cart1, None).cost(), Decimal("4.00"))
     self.assertEqual(per(self.cart1, None).cost(), Decimal("12.00"))
Exemplo n.º 3
0
 def test_downloadable_zero_shipping(self):
     subtypes = config_value('PRODUCT','PRODUCT_TYPES')
     if "product::DownloadableProduct" in subtypes:
         subtype2 = DownloadableProduct.objects.create(product=product1)
         self.assertEqual(product1.get_subtypes(), ('ConfigurableProduct', 'DownloadableProduct'))
         
         self.assertFalse(subtype2.is_shippable)
         self.assertFalse(self.product1.is_shippable)
         self.assertFalse(self.cart1.is_shippable)
         self.assertEqual(flat(self.cart1, None).cost(), Decimal("0.00"))
         self.assertEqual(per(self.cart1, None).cost(), Decimal("0.00"))
Exemplo n.º 4
0
 def test_downloadable_zero_shipping(self):
     subtypes = config_value('PRODUCT','PRODUCT_TYPES')
     if "product::DownloadableProduct" in subtypes:
         subtype2 = DownloadableProduct.objects.create(product=product1)
         self.assertEqual(product1.get_subtypes(), ('ConfigurableProduct', 'DownloadableProduct'))
         
         self.assertFalse(subtype2.is_shippable)
         self.assertFalse(self.product1.is_shippable)
         self.assertFalse(self.cart1.is_shippable)
         self.assertEqual(flat(self.cart1, None).cost(), Decimal("0.00"))
         self.assertEqual(per(self.cart1, None).cost(), Decimal("0.00"))