commit d0200f2bf663b30d1f1b04d3c0d14fd29c2a5d47
parent e7175ba41286e1d71cd8a2571e25c95c58cc14b6
Author: MS <ms@taler.net>
Date: Tue, 15 Dec 2020 17:48:51 +0100
Initiated payments tracking.
Testing the evolution of a initiated payment's status.
This is done entirely at the Nexus level, without any
intervention by the Taler facade.
Diffstat:
1 file changed, 34 insertions(+), 13 deletions(-)
diff --git a/integration-tests/tests.py b/integration-tests/tests.py
@@ -185,19 +185,17 @@ def test_ebics_custom_ebics_order():
# This test makes a payment and expects to see it
# in the account history.
def test_payment():
- resp = assertResponse(
- post(
- f"{PERSONA.nexus.base_url}/bank-accounts/{PERSONA.nexus.bank_label}/payment-initiations",
- json=dict(
- iban="FR7630006000011234567890189",
- bic="AGRIFRPP",
- name="Jacques La Fayette",
- subject="integration test",
- amount="EUR:1",
- ),
- auth=PERSONA.nexus.auth
- )
- )
+ resp = assertResponse(post(
+ f"{PERSONA.nexus.base_url}/bank-accounts/{PERSONA.nexus.bank_label}/payment-initiations",
+ json=dict(
+ iban="FR7630006000011234567890189",
+ bic="AGRIFRPP",
+ name="Jacques La Fayette",
+ subject="integration test",
+ amount="EUR:1",
+ ),
+ auth=PERSONA.nexus.auth
+ ))
PAYMENT_UUID = resp.json().get("uuid")
assertResponse(post("/".join([
PERSONA.nexus.base_url,
@@ -232,6 +230,29 @@ def test_payment():
))
assert resp.json()["status"] == "BOOK"
+ # Posting a second payment initiation, but not submitting it.
+ resp = assertResponse(post(
+ f"{PERSONA.nexus.base_url}/bank-accounts/{PERSONA.nexus.bank_label}/payment-initiations",
+ json=dict(
+ iban="FR7630006000011234567890189",
+ bic="AGRIFRPP",
+ name="Jacques La Fayette",
+ subject="integration test",
+ amount="EUR:1",
+ ),
+ auth=PERSONA.nexus.auth
+ ))
+ PAYMENT_UUID_NON_SUBMITTED = resp.json().get("uuid")
+ resp = assertResponse(get("/".join([
+ PERSONA.nexus.base_url,
+ "bank-accounts",
+ PERSONA.nexus.bank_label,
+ "payment-initiations",
+ PAYMENT_UUID_NON_SUBMITTED]),
+ auth=PERSONA.nexus.auth
+ ))
+ assert resp.json()["status"] == None
+
@pytest.fixture
def fetch_transactions():