[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-bank] 03/10: fix logging
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-bank] 03/10: fix logging |
Date: |
Wed, 12 Jul 2017 12:55:39 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository bank.
commit 563c343fb403056070107008e52df555ed1f5d64
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon May 29 15:44:26 2017 +0200
fix logging
---
talerbank/app/tests_err.py | 7 +++++--
talerbank/app/views.py | 3 ++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/talerbank/app/tests_err.py b/talerbank/app/tests_err.py
index 26b1ae7..94b5efd 100644
--- a/talerbank/app/tests_err.py
+++ b/talerbank/app/tests_err.py
@@ -161,8 +161,8 @@ class AddIncomingTestCase(TestCase):
"wtid": "TESTWTID", \
"exchange_url": "https://exchange.test", \
"amount": \
- {"value": 60, \
- "fraction": 0, \
+ {"value": 50, \
+ "fraction": 1, \
"currency": "%s"}}' \
% settings.TALER_CURRENCY
response = c.post(reverse("add-incoming", urlconf=urls),
@@ -170,6 +170,9 @@ class AddIncomingTestCase(TestCase):
content_type="application/json",
follow=True, **{"HTTP_X_TALER_BANK_USERNAME":
"user_user", "HTTP_X_TALER_BANK_PASSWORD": "user_password"})
+ # FIXME: test expected status code
+ self.assertEqual(403, response.status_code)
+
class HistoryTestCase(TestCase):
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index ea177b0..911a35e 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -493,6 +493,7 @@ def add_incoming(request):
except SameAccountException:
return JsonResponse(dict(error="debit and credit account are the
same"), status=422)
except DebtLimitExceededException:
+ logger.info("Prevenetd transfer, debit account would go beyond debt
threshold")
return JsonResponse(dict(error="debit count has reached its debt
limit", status=403 ),
status=403)
except amounts.CurrencyMismatchException as e:
@@ -587,7 +588,7 @@ def wire_transfer(amount,
if 1 == amounts.amount_cmp(debit_account.balance_obj, threshold) \
and 0 != amounts.amount_cmp(amounts.get_zero(), threshold) \
and debit_account.debit:
- logger.error("Negative balance '%s' not allowed." %
json.dumps(debit_account.balance_obj))
+ logger.info("Negative balance '%s' not allowed." %
json.dumps(debit_account.balance_obj))
logger.info("%s's threshold is: '%s'." %
(debit_account.user.username, json.dumps(threshold)))
raise DebtLimitExceededException()
except amounts.CurrencyMismatchException:
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-bank] branch master updated (82128e4 -> e9bb1a6), gnunet, 2017/07/12
- [GNUnet-SVN] [taler-bank] 05/10: add testcase wrapper for faulty testcases, gnunet, 2017/07/12
- [GNUnet-SVN] [taler-bank] 02/10: only enabling faulty tests, faster testing., gnunet, 2017/07/12
- [GNUnet-SVN] [taler-bank] 06/10: running a test against a non existent config file., gnunet, 2017/07/12
- [GNUnet-SVN] [taler-bank] 08/10: No #-line within make rule, gnunet, 2017/07/12
- [GNUnet-SVN] [taler-bank] 07/10: comment, gnunet, 2017/07/12
- [GNUnet-SVN] [taler-bank] 09/10: using logger in test launchers, gnunet, 2017/07/12
- [GNUnet-SVN] [taler-bank] 01/10: re-enabling faulty tests, gnunet, 2017/07/12
- [GNUnet-SVN] [taler-bank] 03/10: fix logging,
gnunet <=
- [GNUnet-SVN] [taler-bank] 04/10: config parser catches exception for config file not found, gnunet, 2017/07/12
- [GNUnet-SVN] [taler-bank] 10/10: Unifying all tests in one file., gnunet, 2017/07/12