From 0c7cdcdd208150400ef44dbe9a7cfb7a43e3bd12 Mon Sep 17 00:00:00 2001 From: Julian Rother <julianr@fsmpi.rwth-aachen.de> Date: Thu, 26 Nov 2020 15:24:27 +0100 Subject: [PATCH] fixed oauth authorization test --- tests/test_oauth2.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_oauth2.py b/tests/test_oauth2.py index c5d024ec..1d9751b7 100644 --- a/tests/test_oauth2.py +++ b/tests/test_oauth2.py @@ -87,6 +87,10 @@ class TestViews(UffdTestCase): data={'loginname': 'testuser', 'password': 'userpassword'}, follow_redirects=True) state = 'teststate' r = self.client.get(path=url_for('oauth2.authorize', response_type='code', client_id='test', state=state, redirect_uri='http://localhost:5009/callback'), follow_redirects=False) + while True: + if r.status_code != 302 or r.location.startswith('http://localhost:5009/callback'): + break + r = self.client.get(r.location, follow_redirects=False) self.assertEqual(r.status_code, 302) self.assertTrue(r.location.startswith('http://localhost:5009/callback')) args = parse_qs(urlparse(r.location).query) -- GitLab