Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix acquisition translation problem #2823

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/api/acquisition/test_acquisition_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def test_create_accounts(client, rero_json_header, org_martigny, lib_martigny,
_del_resource(client, 'acac', root_account.pid)


# DEV NOTES : This mock will prevent any translations problems to occurs
# When a translation is done, then the input string will be return
# without any changes.
@mock.patch('rero_ils.modules.acq_accounts.api._',
mock.MagicMock(side_effect=lambda v: v))
def test_transfer_funds_api(client, rero_json_header, org_martigny,
lib_martigny, budget_2020_martigny,
librarian_martigny):
Expand All @@ -101,8 +106,8 @@ def _check_account(account):
# STEP 0 :: Create account tree
# Test structure account is described below. Each account are noted like
# A{x, y} where :
# * 'A' is the accont name
# * 'x' is the accont allocated amount
# * 'A' is the account name
# * 'x' is the account allocated amount
# * 'y' is the account remaining_balance
#
# A{2000, 500} E{200, 100}
Expand Down Expand Up @@ -178,7 +183,6 @@ def _check_account(account):
res = client.get(url_for('api_acq_account.transfer_funds'))
assert res.status_code == 400
assert 'argument is required' in res.get_data(as_text=True)

cases_to_test = [{
'source': 'dummy', 'target': 'dummy', 'amount': 'dummy',
'error': 'Unable to load source account'
Expand Down