diff --git a/tests/test_html.py b/tests/test_html.py index 331b461..790d305 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -224,3 +224,21 @@ def test_render_twice(self): ), "

Header

", ) + + def test_engine_is_global_for_existing_instances(self): + html_string = HTML({"engine": DOM.STRING}) + HTML({"engine": DOM.STRING_COMPAT}) + + self.assertEqual( + html_string.render({"entityMap": {}, "blocks": [{"text": 'Quote "here"'}]}), + "

Quote "here"

", + ) + + def test_engine_switching_affects_previous_instance(self): + html_compat = HTML({"engine": DOM.STRING_COMPAT}) + HTML({"engine": DOM.STRING}) + + self.assertEqual( + html_compat.render({"entityMap": {}, "blocks": [{"text": 'Quote "here"'}]}), + '

Quote "here"

', + )