From cbbd0eb9c144585f01170a19e616ba3aff66e6a5 Mon Sep 17 00:00:00 2001 From: Bernhard Mallinger Date: Wed, 11 Dec 2024 14:25:48 +0100 Subject: [PATCH] Fix rendering of job results in html (#1870) * Fix rendering of job results in html This is basically the same fix as 42f833485b45e92b8ab0a8f86562b81aae05c723 , but in a different template. * Use pygeoapi.util.to_json instead of jinja tojson --- pygeoapi/templates/jobs/job.html | 2 +- pygeoapi/templates/jobs/results/index.html | 2 +- tests/api/test_processes.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pygeoapi/templates/jobs/job.html b/pygeoapi/templates/jobs/job.html index f75d2cf24..c49f05c1b 100644 --- a/pygeoapi/templates/jobs/job.html +++ b/pygeoapi/templates/jobs/job.html @@ -27,7 +27,7 @@

{% trans %}Parameters{% endtrans %}


               
               
               {% endif %}
diff --git a/pygeoapi/templates/jobs/results/index.html b/pygeoapi/templates/jobs/results/index.html
index 4810f6248..9b2b267f5 100644
--- a/pygeoapi/templates/jobs/results/index.html
+++ b/pygeoapi/templates/jobs/results/index.html
@@ -11,6 +11,6 @@ 

{% trans %}Results of job{% endtrans %} {{data.job.id}}


   
   
 {% endblock %}
diff --git a/tests/api/test_processes.py b/tests/api/test_processes.py
index 62256e4b1..6062f5666 100644
--- a/tests/api/test_processes.py
+++ b/tests/api/test_processes.py
@@ -435,7 +435,8 @@ def test_get_job_result(api_):
     # default response is html
     assert code == HTTPStatus.OK
     assert rsp_headers['Content-Type'] == 'text/html'
-    assert 'Hello Sync Test!' in response
+    result = 'JSON.stringify({"id":"echo","value":"Hello Sync Test!"}'
+    assert result in response
 
     rsp_headers, code, response = get_job_result(
         api_, mock_api_request({'f': 'json'}), job_id,