2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 19:20:55 +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

@ -244,6 +244,19 @@ class StockItemListTest(StockAPITestCase):
response = self.get_stock(expired=0)
self.assertEqual(len(response), 16)
def test_paginate(self):
"""
Test that we can paginate results correctly
"""
for n in [1, 5, 10]:
response = self.get_stock(limit=n)
self.assertIn('count', response)
self.assertIn('results', response)
self.assertEqual(len(response['results']), n)
class StockItemTest(StockAPITestCase):
"""