gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-bank] branch master updated: Fix testcase preparatio


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] branch master updated: Fix testcase preparation
Date: Wed, 01 Feb 2017 23:50:55 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new 4e0efc8  Fix testcase preparation
4e0efc8 is described below

commit 4e0efc8132dceafc4502340ecaf7bd3775ca1d12
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Feb 1 23:50:29 2017 +0100

    Fix testcase preparation
---
 talerbank/app/tests.py     | 14 ++++++++++++--
 talerbank/app/urlsadmin.py |  4 ++--
 talerbank/app/views.py     |  2 ++
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index 22f213f..c4f3ca1 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -89,10 +89,20 @@ class AddIncomingTestCase(TestCase):
                                         password="user_password")
         user_account = BankAccount(user=user,
                                    currency=settings.TALER_CURRENCY)
+        bank_account.save()
+        user_account.save()
+        settings.ROOT_URLCONF = "talerbank.app.urlsadmin"
 
     def tearDown(self):
         clearDb()
 
     def test_add_incoming(self):
-       x = BankAccount.objects.all()
-       print(x.len())
+        c = Client()
+        response = c.post(reverse("add-incoming"),
+                          {"debit_account": 1,
+                           "credit_account": 2,
+                           "wtid": "test_wtid",
+                           "amount": {"value": 1,
+                                      "fraction": 0,
+                                      "currency": "TROIO"}},
+                           follow=True)
diff --git a/talerbank/app/urlsadmin.py b/talerbank/app/urlsadmin.py
index 9f2f78b..e2e51f8 100644
--- a/talerbank/app/urlsadmin.py
+++ b/talerbank/app/urlsadmin.py
@@ -15,9 +15,9 @@
 #  @author Marcello Stanisci
 
 from django.conf.urls import include, url
-from . import funds
+from . import views
 
 urlpatterns = [
     url(r'^', include('talerbank.urls')),
-    url(r'^admin/add/incoming$', funds.add_incoming, name="add-incoming"),
+    url(r'^admin/add/incoming$', views.add_incoming, name="add-incoming"),
     ]
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index fc4abfb..4cc5673 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -296,7 +296,9 @@ def add_incoming(request):
     within the browser, and only over the private admin interface.
     """
     logger.info("handling /admin/add/incoming")
+    logger.info("about to crash")
     data = json.loads(request.body.decode("utf-8"))
+    logger.info(json.dumps(data))
     try:
         schemas.validate_incoming_request(data)
     except ValueError:

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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