test with non-rounded values for diy-frame prices
This commit is contained in:
+2
-2
@@ -149,12 +149,12 @@ def canvas_frame_price(width, height, stock_price, market, additional_price=None
|
||||
return price
|
||||
|
||||
|
||||
def old_canvas_diy_frame_price(width, height, market, reseller=None, inc_vat=True):
|
||||
def old_canvas_diy_frame_price(width, height, market, reseller=None, rounded=True, inc_vat=True):
|
||||
# todo: when product models are in place we should use stockproduct ""Do it yourself frame""
|
||||
# instead of hardcoded values
|
||||
stock_price = 1.61084
|
||||
additional_price = 94.750000
|
||||
return canvas_frame_price(width, height, stock_price, market, additional_price, reseller=reseller, rounded=True, inc_vat=inc_vat)
|
||||
return canvas_frame_price(width, height, stock_price, market, additional_price, reseller=reseller, rounded=rounded, inc_vat=inc_vat)
|
||||
|
||||
|
||||
def old_canvas_price(width, height, material, market, framed=True, designer=None, reseller=None, inc_vat=True):
|
||||
|
||||
@@ -86,8 +86,8 @@ def diy_frame():
|
||||
data = [{
|
||||
'width': width,
|
||||
'height': height,
|
||||
'price': old_canvas_diy_frame_price(width, height, market, reseller=reseller),
|
||||
'price_excl_vat': old_canvas_diy_frame_price(width, height, market, reseller=reseller, inc_vat=False)
|
||||
'price': old_canvas_diy_frame_price(width, height, market, reseller=reseller, rounded=False),
|
||||
'price_excl_vat': old_canvas_diy_frame_price(width, height, market, reseller=reseller, rounded=False, inc_vat=False)
|
||||
}]
|
||||
|
||||
return jsonify(data=data)
|
||||
|
||||
@@ -56,4 +56,4 @@ class TestEndpoints(flask_testing.TestCase):
|
||||
product = response.json['data'][0]
|
||||
self.assertEqual(150, product['width'], "it adjusts measurements")
|
||||
self.assertEqual(50, product['height'])
|
||||
self.assertEqual(924, product['price'])
|
||||
self.assertAlmostEqual(923.857, product['price'], places=2)
|
||||
|
||||
Reference in New Issue
Block a user