From 427c56c6e4ebfb450c5ec7c2fafe656f4f1f3763 Mon Sep 17 00:00:00 2001 From: femalves Date: Fri, 23 Feb 2024 16:57:12 -0500 Subject: [PATCH] making bearer token changes --- orcid_service/tests/test_service.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/orcid_service/tests/test_service.py b/orcid_service/tests/test_service.py index 5b26975..acfb9e9 100644 --- a/orcid_service/tests/test_service.py +++ b/orcid_service/tests/test_service.py @@ -441,7 +441,7 @@ def test_store_preferences(self): # wrong request (missing Orcid-Authorization) r = self.client.get(url_for('orcid.preferences', orcid_id='test'), - headers={'Authorization': 'Bearer:secret'}, + headers={'Authorization': 'Bearer secret'}, data=json.dumps({'foo': 'bar'}), content_type='application/json') @@ -449,7 +449,7 @@ def test_store_preferences(self): # no data is there yet (get params ignored) r = self.client.get(url_for('orcid.preferences', orcid_id='test'), - headers={'Authorization': 'secret', 'Orcid-Authorization': 'Bearer:keyx'}, + headers={'Authorization': 'secret', 'Orcid-Authorization': 'Bearer keyx'}, data=json.dumps({'foo': 'bar'}), content_type='application/json') @@ -458,7 +458,7 @@ def test_store_preferences(self): # try to save something broken (it has to be json) r = self.client.post(url_for('orcid.preferences', orcid_id='test'), - headers={'Authorization': 'secret', 'Orcid-Authorization': 'Bearer:keyx'}, + headers={'Authorization': 'secret', 'Orcid-Authorization': 'Bearer keyx'}, data=json.dumps({'foo': 'bar'})[0:-2], content_type='application/json') @@ -467,7 +467,7 @@ def test_store_preferences(self): # save something r = self.client.post(url_for('orcid.preferences', orcid_id='test'), - headers={'Authorization': 'secret', 'Orcid-Authorization': 'Bearer:keyx'}, + headers={'Authorization': 'secret', 'Orcid-Authorization': 'Bearer keyx'}, data=json.dumps({'foo': 'bar'}), content_type='application/json') @@ -476,7 +476,7 @@ def test_store_preferences(self): # get it back r = self.client.get(url_for('orcid.preferences', orcid_id='test'), - headers={'Authorization': 'secret', 'Orcid-Authorization': 'Bearer:keyx'}, + headers={'Authorization': 'secret', 'Orcid-Authorization': 'Bearer keyx'}, content_type='application/json') self.assertStatus(r, 200)