summaryrefslogtreecommitdiff
path: root/talerbackoffice
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-01-09 13:12:04 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2018-01-09 13:12:04 +0100
commitb3d7a53245156cb35e320eee996a011ebb92746b (patch)
treece014e97cc320387decaed50d7dc972615927ea3 /talerbackoffice
parentac581d98a4f363901661b63d90f6f05fdb530b80 (diff)
downloadbackoffice-b3d7a53245156cb35e320eee996a011ebb92746b.tar.gz
backoffice-b3d7a53245156cb35e320eee996a011ebb92746b.tar.bz2
backoffice-b3d7a53245156cb35e320eee996a011ebb92746b.zip
testing /history
Diffstat (limited to 'talerbackoffice')
-rw-r--r--talerbackoffice/backoffice/backoffice.py1
-rw-r--r--talerbackoffice/tests.py10
2 files changed, 11 insertions, 0 deletions
diff --git a/talerbackoffice/backoffice/backoffice.py b/talerbackoffice/backoffice/backoffice.py
index e59d0e6..b7d0e16 100644
--- a/talerbackoffice/backoffice/backoffice.py
+++ b/talerbackoffice/backoffice/backoffice.py
@@ -63,6 +63,7 @@ def index():
def javascript_licensing():
return flask.render_template("templates/javascript.html")
+
@app.route("/history")
def history():
qs = get_query_string().decode("utf-8")
diff --git a/talerbackoffice/tests.py b/talerbackoffice/tests.py
index 82269a1..20aeece 100644
--- a/talerbackoffice/tests.py
+++ b/talerbackoffice/tests.py
@@ -23,5 +23,15 @@ class BackofficeTestCase(unittest.TestCase):
soup.find("select").option.contents[0])
self.assertEqual(response.status_code, 200)
+ @patch("requests.get")
+ def test_history(self, mocked_get):
+ ret = MagicMock()
+ ret.status_code = 200
+ ret.json.return_value = {}
+ mocked_get.return_value = ret
+ self.app.get("/history?para1=1&para2=2")
+ mocked_get.assert_called_with(
+ "http://backend.example.com/history",
+ params=dict(para1='1', para2='2'))
if __name__ == "__main__":
unittest.main()