Merge branch 'master' of github.com:ckan/ckanext-spatial

This commit is contained in:
amercader 2022-12-19 16:21:07 +01:00
commit 6d12e56b4d
2 changed files with 9 additions and 2 deletions

View File

@ -216,6 +216,13 @@ class TestHarvestedMetadataAPI(SpatialTestBase):
'<?xml version="1.0" encoding="UTF-8"?>\n<xml>Content 1</xml>'
)
# Access human-readable view of content
url = "/harvest/object/{0}/html".format(object_id_1)
r = app.get(url, status=200)
assert(
r.headers["Content-Type"] == "text/html; charset=utf-8"
)
# Access original content in object extra (if present)
url = "/harvest/object/{0}/original".format(object_id_1)
r = app.get(url, status=404)

View File

@ -190,11 +190,11 @@ def get_harvest_object_content(id):
return None
def _transform_to_html(content, xslt_package=None, xslt_path=None):
def transform_to_html(content, xslt_package=None, xslt_path=None):
xslt_package = xslt_package or __name__
xslt_path = xslt_path or \
'../templates/ckanext/spatial/gemini2-html-stylesheet.xsl'
'templates/ckanext/spatial/gemini2-html-stylesheet.xsl'
# optimise -- read transform only once and compile rather
# than at each request