Fix up pagination test
@@ -85,8 +85,8 @@ class TestDocumentSearch(object):
title = html_file.processed_json['title']
query = title.split()[0]
- # Create 30 more same html file
- for _ in range(30):
+ # Create 60 more same html file
+ for _ in range(60):
# Make primary key to None, so django will create new object
html_file.pk = None
html_file.save()
@@ -97,11 +97,11 @@ class TestDocumentSearch(object):
assert resp.status_code == 200
# Check the count is 31 (1 existing and 30 new created)
- assert resp.data['count'] == 31
+ assert resp.data['count'] == 61
# Check there are next url
assert resp.data['next'] is not None
# There should be only 25 data as the pagination is 25 by default
- assert len(resp.data['results']) == 25
+ assert len(resp.data['results']) == 50
# Add `page_size` parameter and check the data is paginated accordingly
search_params['page_size'] = 5
