Skip to content

Commit

Permalink
making bearer token changes
Browse files Browse the repository at this point in the history
  • Loading branch information
femalves committed Feb 23, 2024
1 parent bbb7dda commit 427c56c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions orcid_service/tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,15 @@ 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')

self.assertStatus(r, 400)

# 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')

Expand All @@ -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')

Expand All @@ -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')

Expand All @@ -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)
Expand Down

0 comments on commit 427c56c

Please sign in to comment.