1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-06 05:55:23 +02:00

feat: Shopping List Item Pagination Route (#2145)

* added pagination route for list items

* pytest
This commit is contained in:
Michael Genson 2023-02-19 18:48:19 -06:00 committed by GitHub
parent c6d53fe8b1
commit 35124ea875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View file

@ -101,6 +101,17 @@ def test_shopping_list_items_get_one(
assert response.status_code == 200
def test_shopping_list_items_get_all(
api_client: TestClient,
unique_user: TestUser,
list_with_items: ShoppingListOut,
) -> None:
params = {"page": 1, "perPage": -1, "queryFilter": f"shopping_list_id={list_with_items.id}"}
response = api_client.get(api_routes.groups_shopping_items, params=params, headers=unique_user.token)
pagination_json = utils.assert_derserialize(response, 200)
assert len(pagination_json["items"]) == len(list_with_items.list_items)
def test_shopping_list_items_get_one_404(api_client: TestClient, unique_user: TestUser) -> None:
response = api_client.get(api_routes.groups_shopping_items_item_id(uuid4()), headers=unique_user.token)
assert response.status_code == 404