From be2ecb19a55349c86d384a10feacfa684376fa8f Mon Sep 17 00:00:00 2001 From: Sir Mix-A-Lot Date: Tue, 4 Oct 2016 17:25:17 -0300 Subject: Ignore run boolean elements that have value of false --- tests/docx/body_xml_tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py index e1f88d9..b09aba7 100644 --- a/tests/docx/body_xml_tests.py +++ b/tests/docx/body_xml_tests.py @@ -174,11 +174,21 @@ class ReadXmlElementTests(object): def run_is_not_struckthrough_if_strikethrough_element_is_not_present(self): run = self._read_run_with_properties([]) assert_equal(False, run.is_strikethrough) + + @istest + def run_is_not_struckthrough_if_strikethrough_element_is_present_and_false(self): + run = self._read_run_with_properties([xml_element("w:strike", {"w:val": "false"})]) + assert_equal(False, run.is_strikethrough) @istest def run_is_struckthrough_if_strikethrough_element_is_present(self): run = self._read_run_with_properties([xml_element("w:strike")]) assert_equal(True, run.is_strikethrough) + + @istest + def run_is_struckthrough_if_strikethrough_element_is_present_and_true(self): + run = self._read_run_with_properties([xml_element("w:strike", {"w:val": "true"})]) + assert_equal(True, run.is_strikethrough) @istest def run_has_baseline_vertical_alignment_if_vertical_alignment_element_is_not_present(self): -- cgit v1.2.3