Skip to content

Commit

Permalink
tests: Add get studies pagination tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bdewilde committed May 13, 2024
1 parent 279aaee commit 7227014
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion colandr/apis/resources/studies.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class StudiesResource(Resource):
),
"page": ma_fields.Int(load_default=0, validate=Range(min=0)),
"per_page": ma_fields.Int(
load_default=25, validate=OneOf([10, 25, 50, 100, 5000])
load_default=25, validate=OneOf([1, 10, 25, 50, 100, 5000])
),
},
location="query",
Expand Down
2 changes: 2 additions & 0 deletions tests/api/test_studies.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ class TestStudiesResource:
(1, {"review_id": 1, "data_extraction_status": "not_started"}, [1]),
(1, {"review_id": 1, "order_by": "relevance"}, [1, 2, 3]),
(1, {"review_id": 1, "order_by": "recency"}, [1, 2, 3]),
(1, {"review_id": 1, "order_by": "recency", "page": 0, "per_page": 1}, [3]),
(1, {"review_id": 1, "order_by": "recency", "page": 1, "per_page": 1}, [2]),
],
)
def test_get(self, current_user_id, params, study_ids, app, client, db_session):
Expand Down

0 comments on commit 7227014

Please sign in to comment.