Skip to content

Commit

Permalink
test(stats): fix stats endpoint
Browse files Browse the repository at this point in the history
Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
Garfield-fr committed May 14, 2024
1 parent f234ef4 commit 4dd1dd5
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/api/items/test_items_rest_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@
from rero_ils.modules.operation_logs.api import OperationLogsSearch


def test_item_stats_endpoint(
item_at_desk_martigny_patron_and_loan_at_desk,
client, librarian_martigny
):
"""Test loan filter on stats endpoint with real data."""
login_user_via_session(client, librarian_martigny.user)
res = client.get(url_for(
'api_item.stats',
item_pid=item_at_desk_martigny_patron_and_loan_at_desk[0].pid
))
assert res.json['total']['request'] == 1


def test_item_dumps(client, item_lib_martigny, org_martigny,
librarian_martigny):
"""Test item dumps and Elasticsearch version."""
Expand Down Expand Up @@ -195,16 +208,3 @@ def test_item_stats(
{
'total': {'checkin': 2},
'total_year': {'checkin': 1}}


def test_item_stats_endpoint(
item_at_desk_martigny_patron_and_loan_at_desk,
client, librarian_martigny
):
"""Test loan filter on stats endpoint with real data."""
login_user_via_session(client, librarian_martigny.user)
res = client.get(url_for(
'api_item.stats',
item_pid=item_at_desk_martigny_patron_and_loan_at_desk[0].pid
))
assert res.json['total']['request'] == 1

0 comments on commit 4dd1dd5

Please sign in to comment.