search response includes min and max prices

This commit is contained in:
Sam
2021-02-26 10:58:36 +00:00
parent 9b02c05f4e
commit 86020afd27
3 changed files with 40 additions and 7 deletions

View File

@@ -514,6 +514,12 @@ class ProductSearchTest(TestCase):
self.assertEqual(response.status_code, 200)
# load response data
payload = response.json()
# check for expected fields in payload
self.assertIsNotNone(payload.get('filters'))
self.assertIsNotNone(payload.get('count'))
self.assertIsNotNone(payload.get('products'))
self.assertIsNotNone(payload.get('prices'))
# check for object creation
self.assertEquals(len(payload['products']), len(expected_instances))
# check results ordered by rank
@@ -524,6 +530,9 @@ class ProductSearchTest(TestCase):
# check for filters
self.assertNotEquals([], payload['filters']['tags']['singles'])
self.assertTrue(len(payload['filters']['tags']) >= 2 )
# check prices
self.assertTrue(payload['prices']['min'] <= payload['prices']['max'])
def test_anon_user_can_paginate_search(self):
expected_instances = [