-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
notifications: fix patron with additional email
* Sends the notification to the patron additional email if exists instead of the library. * Closes #2152. * Adapts the fixtures to have a user with an additional email only. Co-Authored-by: Johnny Mariéthoz <[email protected]> Co-Authored-by: Bertrand Zuchuat <[email protected]>
- Loading branch information
1 parent
b6b0758
commit 417754b
Showing
4 changed files
with
125 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,7 +116,6 @@ | |
"pid": "5", | ||
"birth_date": "2004-10-11", | ||
"city": "Aosta", | ||
"email": "[email protected]", | ||
"username": "helder", | ||
"first_name": "Helder", | ||
"roles": [ | ||
|
@@ -135,7 +134,8 @@ | |
"$ref": "https://bib.rero.ch/api/patron_types/2" | ||
}, | ||
"communication_channel": "email", | ||
"communication_language": "ita" | ||
"communication_language": "ita", | ||
"additional_communication_email": "[email protected]" | ||
} | ||
}, | ||
{ | ||
|
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 |
---|---|---|
|
@@ -373,6 +373,23 @@ def patron_sion_without_email1( | |
yield create_patron(data) | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def patron_sion_with_additional_email( | ||
app, | ||
roles, | ||
lib_sion, | ||
patron_type_grown_sion, | ||
patron_sion_data): | ||
"""Create Sion patron with an additional email only.""" | ||
data = deepcopy(patron_sion_data) | ||
del data['email'] | ||
data['pid'] = 'ptrn10additionalemail' | ||
data['username'] = 'additionalemail' | ||
data['patron']['additional_communication_email'] = \ | ||
'[email protected]' | ||
yield create_patron(data) | ||
|
||
|
||
# ------------ Loans: pending loan ---------- | ||
@pytest.fixture(scope="module") | ||
def loan_pending_martigny( | ||
|