Commit fb3fc1d2 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

test_rest: Make sure that perpage param is respected

No test covered this yet. Pagination regressed and had to be fixed
recently, so let's test it properly.
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent 7be528eb
......@@ -353,6 +353,22 @@ class APITest(APITestBase):
self.assertTrue('id' in submitter.keys())
self.assertTrue('name' in submitter.keys())
def testPerPagePagination(self):
json = self.get_json('/projects/%(project_id)s/series/',
params={'perpage': '1'})
self.assertEqual(1, len(json['results']))
self.assertTrue(json['next'] is not None)
json = self.get_json('/projects/%(project_id)s/series/',
params={'perpage': '2'})
self.assertEqual(2, len(json['results']))
self.assertTrue(json['next'] is not None)
json = self.get_json('/projects/%(project_id)s/series/',
params={'perpage': '3'})
self.assertEqual(3, len(json['results']))
self.assertTrue(json['next'] is None)
def testSeriesFilters(self):
filters = [
('submitted_since', '2015-06-01', self.n_series - 1),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment