From f8cde3a2f689eec00d0a5f617542cff435ed860c Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Mon, 4 Jun 2018 22:08:39 +0200 Subject: Adapt tests. Assertions from Python tests needed to care about the use of the HTTP "Authentication" header. --- talerbackoffice/tests.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/talerbackoffice/tests.py b/talerbackoffice/tests.py index 704c2b9..4ed870b 100644 --- a/talerbackoffice/tests.py +++ b/talerbackoffice/tests.py @@ -33,7 +33,8 @@ class BackofficeTestCase(unittest.TestCase): response = self.app.get("/track/order?para1=1¶2=2") mocked_get.assert_called_with( "http://backend.example.com/track/transaction", - params=dict(para1='1', para2='2')) + params=dict(para1='1', para2='2'), + headers={"Authorization": "ApiKey sandbox"}) # check data is returned verbatim from the backend self.assertEqual(response.data, b'{}\n') @@ -48,7 +49,8 @@ class BackofficeTestCase(unittest.TestCase): response = self.app.get("/track/transfer?para1=1¶2=2") mocked_get.assert_called_with( "http://backend.example.com/track/transfer", - params=dict(para1='1', para2='2')) + params=dict(para1='1', para2='2'), + headers={"Authorization": "ApiKey sandbox"}) # check data is returned verbatim from the backend self.assertEqual(response.data, b'{}\n') @@ -62,7 +64,8 @@ class BackofficeTestCase(unittest.TestCase): response = self.app.get("/history?para1=1¶2=2") mocked_get.assert_called_with( "http://backend.example.com/history", - params=dict(para1='1', para2='2')) + params=dict(para1='1', para2='2'), + headers={"Authorization": "ApiKey sandbox"}) self.assertEqual(response.data, b'{}\n') def test_javascript_license_page(self): -- cgit v1.2.3