gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-bank] branch master updated: testing


From: gnunet
Subject: [taler-bank] branch master updated: testing
Date: Tue, 25 Aug 2020 18:55:37 +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 5b00b44  testing
5b00b44 is described below

commit 5b00b4421398f5299d78b74b0774b5d12576365f
Author: MS <ms@taler.net>
AuthorDate: Tue Aug 25 18:54:21 2020 +0200

    testing
    
    Testing the balance query offered by the access API.
    Although the response code is 200, the response body
    does not match the documentation.
---
 talerbank/app/tests.py | 20 +++++++++++++++++++-
 talerbank/app/urls.py  |  4 +++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index 97e48d9..061dc49 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -64,9 +64,27 @@ def clear_db():
         cursor.execute("ALTER SEQUENCE app_bankaccount_account_no_seq" " 
RESTART")
         cursor.execute("ALTER SEQUENCE app_banktransaction_id_seq RESTART")
 
+class AccessApiBalanceTestCase(TestCase):
+    def setUp(self):
+        clear_db()
+        self.user = User.objects.create_user(username="RandomUser", 
password="XYZ")
+        self.user.save()
+        self.user_bank_account = BankAccount(user=self.user)
+        self.user_bank_account.save()
+
+    def test_balance(self):
+        c = Client()
+        r = c.get(
+            reverse("access-api-balance", kwargs=dict(acct_id="RandomUser")),
+            HTTP_AUTHORIZATION=make_auth_line("RandomUser", "XYZ"),
+        )
+        self.assertEqual(r.status_code, 200)
+        print(r.content.decode("utf-8"))
+
+
 # Testing the "Access API":
 #     (testing) registration + ask for balance + withdraw: create / ask status 
/ abort / confirm.
-class TestingRegistrationTestCase(TestCase):
+class AccessApiTestingRegistrationTestCase(TestCase):
     def setUp(self):
         clear_db()
         self.user = User.objects.create_user(username="Bank", password="Bank")
diff --git a/talerbank/app/urls.py b/talerbank/app/urls.py
index b4bc047..495c084 100644
--- a/talerbank/app/urls.py
+++ b/talerbank/app/urls.py
@@ -55,7 +55,9 @@ taler_bank_api_patterns = [
 
 # These paths are part of the bank access API
 taler_bank_accounts_api_patterns = [
-    path("accounts/<str:acct_id>/balance", views.bank_accounts_api_balance),
+    path("accounts/<str:acct_id>/balance",
+         views.bank_accounts_api_balance,
+         name="access-api-balance"),
     path(
         "accounts/<str:acct_id>/withdrawals", 
views.bank_accounts_api_create_withdrawal
     ),

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]