Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making bearer token changes #50

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading