forked from rero/rero-ils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
circulation: manage non-circulating libraries
With this commit, for libraries with no pickup locations the system considers the first library location as transaction location for circulation transactions. * Allows requests on items of non-circulating libraries at external locations. * Closes rero#2367 * Adds a non-circulating library to units testing. Co-Authored-by: Aly Badr <aly.badr@rero.ch>
- Loading branch information
Aly Badr
committed
Oct 1, 2021
1 parent
dd87109
commit 9d1cbb8
Showing
7 changed files
with
306 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# RERO ILS | ||
# Copyright (C) 2020 RERO | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Tests REST checkout API methods in library with no circulation.""" | ||
|
||
from invenio_accounts.testutils import login_user_via_session | ||
from utils import postdata | ||
|
||
|
||
def test_requesting_item_from_non_circulating_library( | ||
client, librarian_martigny, lib_martigny, lib_martigny_bourg, | ||
patron_martigny, loc_public_martigny, loc_public_martigny_bourg, | ||
item_lib_martigny_bourg, circulation_policies, patron2_martigny): | ||
"""Test requests at non circulating library.""" | ||
# TEST: a librarian from an external library can request and item from a | ||
# non circulation library to be picked-up at his own library. | ||
login_user_via_session(client, librarian_martigny.user) | ||
res, data = postdata( | ||
client, | ||
'api_item.librarian_request', | ||
dict( | ||
item_pid=item_lib_martigny_bourg.pid, | ||
patron_pid=patron_martigny.pid, | ||
pickup_location_pid=loc_public_martigny.pid, | ||
transaction_library_pid=lib_martigny_bourg.pid, | ||
transaction_user_pid=librarian_martigny.pid | ||
) | ||
) | ||
assert res.status_code == 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.