Repository: galaxyproject/planemo
Issue: Workflow testing on external galaxy fails with 500 Internal server error

I am running workflow tests on an external Galaxy with the following command

```
 planemo --verbose \\
         test --engine external_galaxy \\
              --galaxy_user_key $GLX_DEV_INSTALL \\
              --galaxy_admin_key $GLX_DEV_INSTALL \\
              --test_output test.html \\
              --no_shed_install \\
              --galaxy_url $GALAXY_BASEURL \\
              gxid://workflows/${WORKFLOW_ID}?runnable_path=${CI_PROJECT_DIR}/${WORKFLOW}
```

the workflow is invoked and executed successfully but the test fails with the following error message.

```
Failed to execute Galaxy activity, throwing ErrorRunResponse
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/planemo/galaxy/activity.py", line 48, in execute
    return _execute(ctx, config, runnable, job_path, **kwds)
  File "/usr/local/lib/python3.6/dist-packages/planemo/galaxy/activity.py", line 219, in _execute
    run_response.collect_outputs(ctx, output_directory)
  File "/usr/local/lib/python3.6/dist-packages/planemo/galaxy/activity.py", line 358, in collect_outputs
    dataset_dict = get_dataset(dataset)
  File "/usr/local/lib/python3.6/dist-packages/planemo/galaxy/activity.py", line 337, in get_dataset
    destination = self.download_output_to(dataset_details, output_directory, filename=filename)
  File "/usr/local/lib/python3.6/dist-packages/planemo/galaxy/activity.py", line 430, in download_output_to
    filename=filename,
  File "/usr/local/lib/python3.6/dist-packages/planemo/galaxy/activity.py", line 443, in _history_content_download
    r.raise_for_status()
  File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: BASEURL/api/histories/5eaf6075747779e4/contents/f811d48e90c6cbe4/display
Test case [TestCase (Test outline for ts_tool_test.ga) for runnable (Runnable(uri='gxid://workflows/3af9fbe9a5f5994b?runnable_path=/opt/mount/workflows/test/ts_tool_test/ts_tool_test.ga', type=<RunnableType.galaxy_workflow: 3>)) with job ({'input_file': {'class': 'File', 'path': 'test-data/input_file.tabular'}}) and expected outputs ({'output_file': {'class': 'File', 'path': 'test-data/output_file.tabular'}}) in directory (/opt/mount/workflows/test/ts_tool_test) with id (0)] resulted in run response [Run failed with message [500 Server Error: Internal Server Error for url: BASEURL/api/histories/5eaf6075747779e4/contents/f811d48e90c6cbe4/display]]
engine.test returning [<planemo.test.results.StructuredData object at 0x7f73b815cf98>]
```

I replaced the actual Galaxy URL with BASEURL in this. 

The URL to retrieve the dataset works fine in a browser with an authenticated Galaxy session, as well as using curl from the command line with the authentication cookie from the browser session.

Planemo version is 0.74.1, running against a Galaxy 21.01


Changed files:
planemo/galaxy/activity.py

diff --git a/planemo/galaxy/activity.py b/planemo/galaxy/activity.py
index e0fe708d..9f3298c1 100644
--- a/planemo/galaxy/activity.py
+++ b/planemo/galaxy/activity.py
@@ -8,7 +8,6 @@ import time
 import traceback
 
 import bioblend
-import requests
 from bioblend.util import attach_file
 from galaxy.tool_util.client.staging import (
     StagingInterace,
@@ -439,7 +438,7 @@ class GalaxyBaseRunResponse(SuccessfulRunResponse):
         if filename:
             data["filename"] = filename
 
-        r = requests.get(url, params=data, verify=user_gi.verify, stream=True, timeout=user_gi.timeout)
+        r = user_gi.make_get_request(url, params=data, stream=True, timeout=user_gi.timeout)
         r.raise_for_status()
 
         with open(to_path, 'wb') as fp: