From dd1769b954bcfe064f3eec3f86a1d0b0d9b8e877 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 6 Apr 2021 08:54:09 +0300 Subject: [PATCH] tests: Fix totalPages A few months ago I fixed the totalPages display to show 1 when we only have one page of results (the page itself is still 0), but I didn't update the tests. See: 4f8cd1097bd0b1384540518304cbfdb88f73d151 --- tests/test_api_collections.py | 2 +- tests/test_api_communities.py | 2 +- tests/test_api_items.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_api_collections.py b/tests/test_api_collections.py index 6cb7b07..64fee9a 100644 --- a/tests/test_api_collections.py +++ b/tests/test_api_collections.py @@ -312,7 +312,7 @@ def test_post_collections_valid_page(client): assert response.status_code == 200 assert response.json["limit"] == 100 assert response.json["currentPage"] == 0 - assert response.json["totalPages"] == 0 + assert response.json["totalPages"] == 1 assert len(response.json["statistics"]) == 2 assert isinstance(response.json["statistics"][0]["views"], int) assert isinstance(response.json["statistics"][0]["downloads"], int) diff --git a/tests/test_api_communities.py b/tests/test_api_communities.py index b48b063..d704fe4 100644 --- a/tests/test_api_communities.py +++ b/tests/test_api_communities.py @@ -312,7 +312,7 @@ def test_post_communities_valid_page(client): assert response.status_code == 200 assert response.json["limit"] == 100 assert response.json["currentPage"] == 0 - assert response.json["totalPages"] == 0 + assert response.json["totalPages"] == 1 assert len(response.json["statistics"]) == 2 assert isinstance(response.json["statistics"][0]["views"], int) assert isinstance(response.json["statistics"][0]["downloads"], int) diff --git a/tests/test_api_items.py b/tests/test_api_items.py index bac322c..575f298 100644 --- a/tests/test_api_items.py +++ b/tests/test_api_items.py @@ -312,7 +312,7 @@ def test_post_items_valid_page(client): assert response.status_code == 200 assert response.json["limit"] == 100 assert response.json["currentPage"] == 0 - assert response.json["totalPages"] == 0 + assert response.json["totalPages"] == 1 assert len(response.json["statistics"]) == 2 assert isinstance(response.json["statistics"][0]["views"], int) assert isinstance(response.json["statistics"][0]["downloads"], int)