Skip to content

Commit

Permalink
Merge pull request #50 from adsabs/token_changes
Browse files Browse the repository at this point in the history
making bearer token changes
  • Loading branch information
femalves authored Mar 5, 2024
2 parents 65b2eb7 + 427c56c commit 7b7d917
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 @@ -492,15 +492,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 @@ -509,7 +509,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 @@ -518,7 +518,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 @@ -527,7 +527,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 7b7d917

Please sign in to comment.