Skip to content

Commit

Permalink
Force PUT request headers to JSON in API test
Browse files Browse the repository at this point in the history
Aparentely FastAPI no longer assumes JSON by default.
  • Loading branch information
davelopez committed Jun 14, 2021
1 parent 299a216 commit 3489225
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy_test/api/test_datasets.py
Expand Up @@ -128,7 +128,7 @@ def test_tag_change(self):
'item_class': 'HistoryDatasetAssociation',
'item_tags': ['cool:tag_a', 'cool:tag_b', 'tag_c', 'name:tag_d', '#tag_e'],
})
put_response = self._put("tags", payload)
put_response = self._put("tags", data=payload, headers={'Content-Type': 'application/json'})
self._assert_status_code_is_ok(put_response)
updated_hda = self._get(
f"histories/{self.history_id}/contents/{hda_id}").json()
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_tool_data_delete.py
Expand Up @@ -61,7 +61,7 @@ def test_admin_delete_data_table_entry(self):
self.assertEquals(len(updated_fields), original_count + 1)
new_field = updated_fields[-1]
url = self._api_url(f"tool_data/testbeta?key={self.galaxy_interactor.api_key}")
delete_response = delete(url, data=json.dumps({"values": "\t".join(new_field)}))
delete_response = delete(url, data=json.dumps({"values": "\t".join(new_field)}), headers={'Content-Type': 'application/json'})
delete_response.raise_for_status()
time.sleep(2)
show_response = self._get("tool_data/testbeta")
Expand Down

0 comments on commit 3489225

Please sign in to comment.