diff --git a/tests/test_json.py b/tests/test_json.py index 0d74d87e..73374fd1 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -6,6 +6,7 @@ import pytest from werkzeug.http import http_date import flask +from flask import json @pytest.mark.parametrize("debug", (True, False)) @@ -400,3 +401,12 @@ def test_json_key_sorting(app, client): assert lines == sorted_by_int except AssertionError: assert lines == sorted_by_str + + +def test_html_method(): + class ObjectWithHTML: + def __html__(self): + return "

test

" + + result = json.dumps(ObjectWithHTML()) + assert result == '"

test

"'