refactor material prices

This commit is contained in:
Martin
2016-11-01 14:39:59 +01:00
parent bf9fc3ae5a
commit 0663bedc80
7 changed files with 79 additions and 51 deletions
+10
View File
@@ -23,12 +23,22 @@ class TestEndpoints(flask_testing.TestCase):
db.session.commit()
return material
def test_wallpaper(self):
self._add_material('standard-wallpaper', 1, 236)
self._add_material('premium-wallpaper', 1, 260)
response = self.client.get(
'/prices/wallpaper?width=200&height=10&territory=SE')
self.assert200(response)
products = response.json['data']
self.assertEqual(2, len(products))
def test_canvas(self):
self._add_material('standard-canvas', 2, 799.9)
response = self.client.get(
'/prices/canvas?width=200&height=10&territory=SE')
self.assert200(response)
products = response.json['data']
self.assertEqual(2, len(products))
for product in products:
if product['framed']:
self.assertEqual(150, product['width'])