[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-survey] branch stable updated (c07c0d6 -> 90d2bb4)
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-survey] branch stable updated (c07c0d6 -> 90d2bb4) |
Date: |
Mon, 11 Dec 2017 17:42:01 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a change to branch stable
in repository survey.
from c07c0d6 running tests via 'nose' and 'setuptools'
add 0f3d1a7 use relative import, so PYTHONPATH goes out of 'make check'
add 43debba put next_url in tip spec
add da992bf adjust test
add 90d2bb4 missing import
No new revisions were added by this update.
Summary of changes:
talersurvey/survey/survey.py | 14 ++++++++------
talersurvey/tests.py | 2 ++
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/talersurvey/survey/survey.py b/talersurvey/survey/survey.py
index 80b07d1..6c2f4c8 100644
--- a/talersurvey/survey/survey.py
+++ b/talersurvey/survey/survey.py
@@ -21,7 +21,7 @@ import json
from urllib.parse import urljoin
import flask
import requests
-from talersurvey.talerconfig import TalerConfig
+from ..talerconfig import TalerConfig
from .amount import Amount
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -71,20 +71,22 @@ def utility_processor():
@app.route("/tip-pickup", methods=["POST"])
def pick():
- body = flask.request.get_json()
- resp = requests.post(urljoin(BACKEND_URL, 'tip-pickup'),
- json=body)
+ request_body = flask.request.get_json()
+ resp = requests.post(urljoin(BACKEND_URL, "tip-pickup"),
+ json=request_body)
if resp.status_code != 200:
return backend_error(resp)
- return flask.jsonify(resp.json())
+ response_body = resp.json()
+ return flask.jsonify(response_body)
@app.route("/submit-survey", methods=["POST"])
def submit_survey():
tip_spec = dict(pickup_url=urljoin(flask.request.base_url, "/tip-pickup"),
amount=Amount(CURRENCY, 1).dump(),
+ next_url=os.environ.get("TALER_ENV_URL_INTRO",
"https://taler.net/"),
instance="default",
justification="Payment methods survey")
- resp = requests.post(urljoin(BACKEND_URL, 'tip-authorize'),
+ resp = requests.post(urljoin(BACKEND_URL, "tip-authorize"),
json=tip_spec)
if resp.status_code != 200:
return backend_error(resp)
diff --git a/talersurvey/tests.py b/talersurvey/tests.py
index d5845bc..437a8d3 100644
--- a/talersurvey/tests.py
+++ b/talersurvey/tests.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
+import os
import unittest
from mock import patch, MagicMock
from talersurvey.survey import survey
@@ -28,6 +29,7 @@ class SurveyTestCase(unittest.TestCase):
"http://backend.test.taler.net/tip-authorize",
json={
"pickup_url": "http://localhost/tip-pickup",
+ "next_url": os.environ.get("TALER_ENV_URL_INTRO",
"https://taler.net/"),
"amount": {
"value": 1,
"fraction": 0,
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-survey] branch stable updated (c07c0d6 -> 90d2bb4),
gnunet <=