Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ckan/ckanext-spatial
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Dec 19, 2022
2 parents 5536382 + 48e28e3 commit 6d12e56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ckanext/spatial/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ def test_api(self, app):
'<?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)
Expand Down
4 changes: 2 additions & 2 deletions ckanext/spatial/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d12e56

Please sign in to comment.