summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-08-28 11:24:03 +0200
committerMS <ms@taler.net>2020-08-28 11:24:03 +0200
commit121924732cb231af2aea9eb184613aa14fa9b979 (patch)
tree4dab13b95fa0f45d06e286099d24af768346bba3
parentbda295d06a8464f82895362e2462ded00aaf99ea (diff)
downloadbank-121924732cb231af2aea9eb184613aa14fa9b979.tar.gz
bank-121924732cb231af2aea9eb184613aa14fa9b979.tar.bz2
bank-121924732cb231af2aea9eb184613aa14fa9b979.zip
bring /admin/add-incoming to pass
-rw-r--r--talerbank/app/tests.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index 98a6e72..6928277 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -64,6 +64,35 @@ def clear_db():
cursor.execute("ALTER SEQUENCE app_bankaccount_account_no_seq" " RESTART")
cursor.execute("ALTER SEQUENCE app_banktransaction_id_seq RESTART")
+class WireGatewayTestCase(TestCase):
+ def setUp(self):
+ clear_db()
+ exchange = User.objects.create_user(username="RandomExchange", password="XYZ")
+ exchange.save()
+ customer = User.objects.create_user(username="RandomCustomer", password="ABC")
+ customer.save()
+ exchange_bank_account = BankAccount(
+ user=exchange,
+ balance=SignedAmount(True, Amount(settings.TALER_CURRENCY, 100, 0))
+ )
+ exchange_bank_account.save()
+ customer_bank_account = BankAccount(
+ user=customer,
+ balance=SignedAmount(True, Amount(settings.TALER_CURRENCY, 100, 0))
+ )
+ customer_bank_account.save()
+ self.client = Client()
+
+ def test_add_incoming(self):
+ r = self.client.post(
+ reverse("twg-add-incoming", kwargs=dict(acct_id="RandomExchange")),
+ HTTP_AUTHORIZATION=make_auth_line("RandomExchange", "XYZ"),
+ content_type="application/json",
+ data=dict(amount=f"{settings.TALER_CURRENCY}:10",
+ reserve_pub="FXWC2JHBY8B0XE2MMGAJ9TGPY307TN12HVEKYSTN6HE3GTHTF8XG",
+ debit_account="payto://x-taler-bank/localhost/RandomCustomer"))
+ self.assertEqual(r.status_code, 200)
+
# Testing the "Integration API":
# has three operations: 1) /config, 2,3) create, see status of withdrawal.
class IntegrationConfigTestCase(TestCase):