aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/docx/body_xml_tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py
index 44a3e34..18cba72 100644
--- a/tests/docx/body_xml_tests.py
+++ b/tests/docx/body_xml_tests.py
@@ -405,6 +405,15 @@ class RunTests(object):
run = self._read_run_with_properties([font_size_xml])
assert_equal(None, run.font_size)
+ def test_run_has_no_highlight_by_default(self):
+ run = self._read_run_with_properties([])
+ assert_equal(None, run.highlight)
+
+ def test_run_has_highlight_read_from_properties(self):
+ highlight_xml = xml_element("w:highlight", {"w:val": "yellow"})
+ run = self._read_run_with_properties([highlight_xml])
+ assert_equal("yellow", 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])