Compare commits

...

2 Commits

Author SHA1 Message Date
dgtlmoon
9a8ed6219e Re #462 - check encoding 2022-03-13 11:30:40 +01:00
dgtlmoon
12d16758af JSON use the original char encoding 2022-03-13 10:52:56 +01:00
2 changed files with 7 additions and 3 deletions

View File

@@ -78,7 +78,8 @@ def _parse_json(json_data, jsonpath_filter):
# Re 265 - Just return an empty string when filter not found
return ''
stripped_text_from_html = json.dumps(s, indent=4)
# Ticket #462 - allow the original encoding through, usually it's UTF-8 or similar
stripped_text_from_html = json.dumps(s, indent=4, ensure_ascii=False)
return stripped_text_from_html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/python3
# coding=utf-8
import time
from flask import url_for
@@ -142,7 +143,7 @@ def set_modified_response():
}
],
"boss": {
"name": "Foobar"
"name": "Örnsköldsvik"
},
"available": false
}
@@ -246,8 +247,10 @@ def test_check_json_filter(client, live_server):
# Should not see this, because its not in the JSONPath we entered
res = client.get(url_for("diff_history_page", uuid="first"))
# But the change should be there, tho its hard to test the change was detected because it will show old and new versions
assert b'Foobar' in res.data
# And #462 - check we see the proper utf-8 string there
assert "Örnsköldsvik".encode('utf-8') in res.data
def test_check_json_filter_bool_val(client, live_server):