From 9892cf6c3fc0e3ef2a4095a742c8e8fb73113fb4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 13 Jun 2024 12:58:12 +0100 Subject: Handle highlight value of none --- tests/docx/body_xml_tests.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/docx') diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py index 18cba72..117d966 100644 --- a/tests/docx/body_xml_tests.py +++ b/tests/docx/body_xml_tests.py @@ -414,6 +414,11 @@ class RunTests(object): run = self._read_run_with_properties([highlight_xml]) assert_equal("yellow", run.highlight) + def test_when_highlight_is_none_then_run_has_no_highlight(self): + highlight_xml = xml_element("w:highlight", {"w:val": "none"}) + run = self._read_run_with_properties([highlight_xml]) + assert_equal(None, run.highlight) + def _read_run_with_properties(self, properties, styles=None): properties_xml = xml_element("w:rPr", {}, properties) run_xml = xml_element("w:r", {}, [properties_xml]) -- cgit v1.2.3