2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 22:06:28 +00:00

Server-side paginatino for build orders

This commit is contained in:
Oliver Walters
2021-02-28 20:31:01 +11:00
parent 1239d4af16
commit 90feb6d210
4 changed files with 30 additions and 0 deletions

View File

@ -235,6 +235,19 @@ class PartAPITest(InvenTreeAPITestCase):
self.assertEqual(response.status_code, status.HTTP_200_OK)
def test_paginate(self):
"""
Test pagination of the Part list API
"""
for n in [1, 5, 10]:
response = self.get(reverse('api-part-list'), {'limit': n})
self.assertIn('count', response)
self.assertIn('results', response)
self.assertEqual(len(response['results']), n)
class PartAPIAggregationTest(InvenTreeAPITestCase):
"""