1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-27 00:28:17 +01:00

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: 4f8cd1097b
This commit is contained in:
Alan Orth 2021-04-06 08:54:09 +03:00
parent b009820fb4
commit dd1769b954
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)