adde total_results to search response, for better frontend pagination
This commit is contained in:
@@ -478,6 +478,7 @@ class ProductSearchTest(TestCase):
|
||||
url = f"{self.endpoint}?query_string={query_string}"
|
||||
# send in request
|
||||
response = self.client.get(url)
|
||||
# import ipdb; ipdb.set_trace()
|
||||
|
||||
# check response
|
||||
self.assertEqual(response.status_code, 200)
|
||||
@@ -521,8 +522,9 @@ class ProductSearchTest(TestCase):
|
||||
self.assertEqual(response.status_code, 200)
|
||||
# load response data
|
||||
payload = response.json()
|
||||
# check for object creation
|
||||
self.assertEquals(len(payload['products']), limit)
|
||||
self.assertEquals(payload['total_results'], len(expected_instances))
|
||||
|
||||
|
||||
class MyProductsViewTest(APITestCase):
|
||||
"""my_products tests
|
||||
|
||||
Reference in New Issue
Block a user