P5-2777 add poster price calculations
This commit is contained in:
@@ -152,6 +152,35 @@ class TestEndpoints(flask_testing.TestCase):
|
||||
self.assertEqual(50, product['height'])
|
||||
self.assertAlmostEqual(731.25, product['price'], places=2)
|
||||
|
||||
def test_poster(self):
|
||||
response = self.client.get('/prices/poster?width=50&height=30&territory=SE')
|
||||
self.assert200(response)
|
||||
expected = [
|
||||
{
|
||||
'hanger': True,
|
||||
'height': 30,
|
||||
'price': 337.0,
|
||||
'price_excl_vat': 269.6,
|
||||
'width': 50
|
||||
},
|
||||
{
|
||||
'hanger': False,
|
||||
'height': 30,
|
||||
'price': 168.0,
|
||||
'price_excl_vat': 134.4,
|
||||
'width': 50
|
||||
}
|
||||
]
|
||||
self.assertEqual(expected, response.json['data'])
|
||||
|
||||
def test_poster_hanger(self):
|
||||
response = self.client.get('/prices/poster-hanger?width=50&territory=SE')
|
||||
self.assert200(response)
|
||||
product = response.json['data'][0]
|
||||
self.assertEqual(231.5, product['price'])
|
||||
self.assertEqual(185.2, product['price_excl_vat'])
|
||||
self.assertEqual(50, product['width'])
|
||||
|
||||
def test_inquiry_wallpaper(self):
|
||||
self._add_material('standard-wallpaper', 1, 236)
|
||||
self._add_material('premium-wallpaper', 1, 260)
|
||||
|
||||
Reference in New Issue
Block a user