diff --git a/lib/galaxy_test/api/test_datasets.py b/lib/galaxy_test/api/test_datasets.py index 3c8c9daf3420..9705d2d2b577 100644 --- a/lib/galaxy_test/api/test_datasets.py +++ b/lib/galaxy_test/api/test_datasets.py @@ -343,6 +343,17 @@ def test_display(self, history_id): self._assert_status_code_is(display_response, 200) assert display_response.text == contents + def test_display_error_handling(self, history_id): + hda1 = self.dataset_populator.create_deferred_hda( + history_id, "https://raw.githubusercontent.com/galaxyproject/galaxy/dev/test-data/1.bed" + ) + display_response = self._get(f"histories/{history_id}/contents/{hda1['id']}/display", {"raw": "True"}) + self._assert_status_code_is(display_response, 409) + assert ( + display_response.json()["err_msg"] + == "The dataset you are attempting to view has deferred data. You can only use this dataset as input for jobs." + ) + def test_get_content_as_text(self, history_id): contents = textwrap.dedent( """\