gnunet-svn
[Top][All Lists]
Advanced

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

[taler-bank] branch master updated: testing withdrawal by access API


From: gnunet
Subject: [taler-bank] branch master updated: testing withdrawal by access API
Date: Tue, 25 Aug 2020 19:06:16 +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 4ccf543  testing withdrawal by access API
4ccf543 is described below

commit 4ccf543ac53da668b07dd091f98fbd28fdd0b0bf
Author: MS <ms@taler.net>
AuthorDate: Tue Aug 25 19:06:11 2020 +0200

    testing withdrawal by access API
---
 talerbank/app/tests.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index 061dc49..7a45aa6 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -64,6 +64,28 @@ def clear_db():
         cursor.execute("ALTER SEQUENCE app_bankaccount_account_no_seq" " 
RESTART")
         cursor.execute("ALTER SEQUENCE app_banktransaction_id_seq RESTART")
 
+class AccessApiWithdrawTestCase(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,
+            balance=SignedAmount(True, Amount(settings.TALER_CURRENCY, 100, 0))
+        )
+        self.user_bank_account.save()
+
+    def test_withdraw(self):
+        c = Client()
+        r = c.post(
+            reverse("access-api-withdrawal", 
kwargs=dict(acct_id="RandomUser")),
+            HTTP_AUTHORIZATION=make_auth_line("RandomUser", "XYZ"),
+            content_type="application/json",
+            data=dict(amount=f"{settings.TALER_CURRENCY}:5")
+        )
+        self.assertEqual(r.status_code, 200)
+        print(r.content.decode("utf-8"))
+
 class AccessApiBalanceTestCase(TestCase):
     def setUp(self):
         clear_db()

-- 
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]