From 5fe5dd112d2b35fc6d98ec5f765e08d151111960 Mon Sep 17 00:00:00 2001 From: Sebastian Lobinger <sebastian.lobinger@zib.de> Date: Fri, 6 Oct 2017 11:31:04 +0200 Subject: [PATCH] update test_sams_proxy.py test_token_passthrough to use a session --- test/test_sams_proxy.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test_sams_proxy.py b/test/test_sams_proxy.py index a46d2d5..a4a97bb 100644 --- a/test/test_sams_proxy.py +++ b/test/test_sams_proxy.py @@ -206,6 +206,7 @@ class TestSAMSHubWithThreadedAPI(unittest.TestCase): for param_type in ('header', 'url', 'body'): proxyApp = Flask('test') proxyApp.config['TESTING'] = True + proxyApp.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT' proxy = SAMSProxy( proxySpec = { 'in': '/proxy', 'out': 'http://localhost:4711', @@ -223,6 +224,8 @@ class TestSAMSHubWithThreadedAPI(unittest.TestCase): view_func = proxy.proxy, methods=['GET', 'POST', 'PUT', 'UPDATE', 'PATCH', 'DELETE', 'OPTIONS']) with proxyApp.test_client(self) as client: + with client.session_transaction() as sess: + sess['user'] = 'foo' res = client.get(path='/proxy/passthrough', query_string={'u':'foo'}, data={'g':'bar'}, headers={'lang': 'klingon'}) -- GitLab