[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-bank] branch master updated: Access API.
From: |
gnunet |
Subject: |
[taler-bank] branch master updated: Access API. |
Date: |
Thu, 27 Aug 2020 12:46:44 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository bank.
The following commit(s) were added to refs/heads/master by this push:
new c1e6df5 Access API.
c1e6df5 is described below
commit c1e6df5c2ce4e828074375f4fb0765196cbea3c9
Author: MS <ms@taler.net>
AuthorDate: Thu Aug 27 12:46:12 2020 +0200
Access API.
Testing the 'confirm' operation.
---
talerbank/app/tests.py | 25 ++++++++++++++++++++++++-
talerbank/app/urls.py | 1 +
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index d91aca4..d893637 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -106,7 +106,6 @@ class AccessApiWithdrawTestCase(TestCase):
def test_withdraw_abort(self):
withdrawal_id = self.create_withdrawal()
- self.assertTrue(withdrawal_id)
r = self.client.post(
reverse("access-api-withdrawal-abort",
kwargs=dict(acct_id="RandomUser", wid=withdrawal_id)),
@@ -114,6 +113,30 @@ class AccessApiWithdrawTestCase(TestCase):
)
self.assertEqual(r.status_code, 200)
+ def test_withdraw_confirm(self):
+ withdrawal_id = self.create_withdrawal()
+ r = self.client.post(
+ reverse("access-api-withdrawal-confirm",
+ kwargs=dict(acct_id="RandomUser", wid=withdrawal_id)),
+ HTTP_AUTHORIZATION=make_auth_line("RandomUser", "XYZ"),
+ )
+ self.assertEqual(r.status_code, 200)
+
+ def test_withdraw_abort_then_confirm(self):
+ withdrawal_id = self.create_withdrawal()
+ r = self.client.post(
+ reverse("access-api-withdrawal-abort",
+ kwargs=dict(acct_id="RandomUser", wid=withdrawal_id)),
+ HTTP_AUTHORIZATION=make_auth_line("RandomUser", "XYZ"),
+ )
+ self.assertEqual(r.status_code, 200)
+ r = self.client.post(
+ reverse("access-api-withdrawal-confirm",
+ kwargs=dict(acct_id="RandomUser", wid=withdrawal_id)),
+ HTTP_AUTHORIZATION=make_auth_line("RandomUser", "XYZ"),
+ )
+ self.assertEqual(r.status_code, 409)
+
class AccessApiBalanceTestCase(TestCase):
def setUp(self):
clear_db()
diff --git a/talerbank/app/urls.py b/talerbank/app/urls.py
index 004bad6..e7ccad1 100644
--- a/talerbank/app/urls.py
+++ b/talerbank/app/urls.py
@@ -71,6 +71,7 @@ taler_bank_accounts_api_patterns = [
path(
"accounts/<str:acct_id>/withdrawals/<str:wid>/confirm",
views.bank_accounts_api_confirm_withdrawal,
+ name="access-api-withdrawal-confirm"
),
path(
"accounts/<str:acct_id>/withdrawals/<str:wid>/abort",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.