[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-bank] 05/05: additional fixes as of the 'start' /his
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-bank] 05/05: additional fixes as of the 'start' /history's argument. new crashes when trying to build the history response returning one element having row id in the middle of the id samples. |
Date: |
Sat, 06 May 2017 22:30:47 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository bank.
commit c511745787203f03482c1156b7507a896cc575f7
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat May 6 22:28:15 2017 +0200
additional fixes as of the 'start' /history's argument.
new crashes when trying to build the history response returning
one element having row id in the middle of the id samples.
---
talerbank/app/tests.py | 5 +++++
talerbank/app/views.py | 7 +++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index 54fdfd4..a73e2db 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -129,6 +129,11 @@ class HistoryTestCase(TestCase):
**{"HTTP_X_TALER_BANK_USERNAME": "User",
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
data = response.content.decode("utf-8")
self.assertJSONEqual(data, {"data": []})
+
+ # Get a delta=+1 record in the middle of the list
+ response = c.get(reverse("history", urlconf=urls), {"auth": "basic",
"delta": "+1", "start": "5"},
+ **{"HTTP_X_TALER_BANK_USERNAME": "User",
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
+
# This tests whether a bank account goes red and then
# goes green again
class DebitTestCase(TestCase):
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index fe8652d..e0bb3c0 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -345,8 +345,8 @@ def history(request):
delta = int(parsed_delta.group(2))
# start
start = request.GET.get("start")
-
- # FIXME: test 'delta' behaves well.
+ if start:
+ start = int(start)
sign = parsed_delta.group(1)
if not start:
@@ -374,8 +374,7 @@ def history(request):
if "debit" == direction:
query_string = Q(debit_account=target_account)
- # FIXME problem with 204 No content. A query of +1 with the
- # latest as the start makes the system crash.
+ # FIXME *DO* return 204 No content when history is empty.
qs = BankTransaction.objects.filter(query_string, sign_filter)
if 0 < qs.count():
--
To stop receiving notification emails like this one, please contact
address@hidden