コード例 #1
0
    def testGetPriceNet_2(self):
        """Test a properties which is just in groups
        """
        pm = IPropertyManagement(self.shop.products.product_1)

        price = pm.getPriceNet("size", "Small")
        self.assertEqual("%.2f" % price, "-9.24")

        price = pm.getPriceNet("size", "Medium")
        self.assertEqual("%.2f" % price, "0.84") 

        price = pm.getPriceNet("size", "Large")
        self.assertEqual("%.2f" % price, "18.49") 
コード例 #2
0
    def testGetPriceNet_2(self):
        """Test a properties which is just in groups
        """
        pm = IPropertyManagement(self.shop.products.product_1)

        price = pm.getPriceNet("size", "Small")
        self.assertEqual("%.2f" % price, "-9.24")

        price = pm.getPriceNet("size", "Medium")
        self.assertEqual("%.2f" % price, "0.84")

        price = pm.getPriceNet("size", "Large")
        self.assertEqual("%.2f" % price, "18.49")
コード例 #3
0
    def testGetPriceNet_1(self):
        """Test a property which is in group and product
        """
        pm = IPropertyManagement(self.shop.products.product_1)

        # Note that color prices are taken from product not from group
        price = pm.getPriceNet("color", "Red")
        self.assertEqual("%.2f" % price, "-8.40")

        price = pm.getPriceNet("color", "Blue")
        self.assertEqual(price, 0.0) 

        price = pm.getPriceNet("color", "Green")
        self.assertEqual("%.2f" % price, "12.61") 
コード例 #4
0
    def testGetPriceNet_1(self):
        """Test a property which is in group and product
        """
        pm = IPropertyManagement(self.shop.products.product_1)

        # Note that color prices are taken from product not from group
        price = pm.getPriceNet("color", "Red")
        self.assertEqual("%.2f" % price, "-8.40")

        price = pm.getPriceNet("color", "Blue")
        self.assertEqual(price, 0.0)

        price = pm.getPriceNet("color", "Green")
        self.assertEqual("%.2f" % price, "12.61")