From b5eebcb970dca395f4e199fc26cc6971798a951d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 30 May 2017 11:34:41 +0100 Subject: Set target frame to None when empty string --- tests/docx/body_xml_tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py index 2c418d2..98e93ed 100644 --- a/tests/docx/body_xml_tests.py +++ b/tests/docx/body_xml_tests.py @@ -683,6 +683,17 @@ class HyperlinkTests(object): _read_and_get_document_xml_element(element), is_hyperlink(target_frame="_blank"), ) + + @istest + def empty_target_frame_is_ignored(self): + element = xml_element("w:hyperlink", { + "w:anchor": "start", + "w:tgtFrame": "", + }) + assert_that( + _read_and_get_document_xml_element(element), + is_hyperlink(target_frame=None), + ) @istest -- cgit v1.2.3