PW-349 change minium price for wallpaper on US to 2sqm

This commit is contained in:
Martin
2016-08-08 15:19:54 +02:00
parent 9dbee8ca2c
commit da96b4c183
2 changed files with 16 additions and 1 deletions
+8 -1
View File
@@ -22,7 +22,14 @@ def wallpaper_price(width, height, material_price, market, designer=None, resell
# calculate price per square meter
sqm = (width / 100) * (height / 100)
sqm = max(sqm, 1)
if market.territory == "US":
min_sqm = 2
else:
min_sqm = 1
sqm = max(sqm, min_sqm)
price = sqm * m2_price
# add vat
+8
View File
@@ -14,6 +14,10 @@ denmark = market.from_territory('DK')
denmark.price_adjustments = 1.185
denmark.exchange_rate = 0.799000
us = market.from_territory('US')
us.price_adjustments = 1.05
us.exchange_rate = 0.119800
designer = DesignerFactory()
designer.pricepremium = 17.647
reseller = ContractCustomerFactory(pricepremium=15)
@@ -49,6 +53,10 @@ class TestPrice(unittest2.TestCase):
self.assertEqual(154, wallpaper_price(width=100, height=100, material_price=236,
market=sweden, reseller=ContractCustomerFactory(pricepremium=-47.74)))
def test_wallpaper_price_us(self):
self.assertEqual(59, wallpaper_price(width=100, height=100,
material_price=236, market=us), "Minium price for US is 2 sqm")
def test_canvas_cm2_price(self):
self.assertEqual(0.22, canvas_cm2_price(250))
self.assertEqual(0.22384, canvas_cm2_price(10))