aboutsummaryrefslogtreecommitdiff
path: root/tests/docx/body_xml_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-05-02 11:48:41 +0100
committerMichael Williamson <mike@zwobble.org>2016-05-02 11:48:41 +0100
commita0155bb9c522b9b008ad3933ffcb9609b0f698e7 (patch)
treed3740b735a409b0a8045fad9dfdefe83b264fb0e /tests/docx/body_xml_tests.py
parent85ff4da3812222eaa59b4be434c9118af85ced1b (diff)
Read colspan for table cells
Diffstat (limited to 'tests/docx/body_xml_tests.py')
-rw-r--r--tests/docx/body_xml_tests.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py
index 7ed325c..8fb35cf 100644
--- a/tests/docx/body_xml_tests.py
+++ b/tests/docx/body_xml_tests.py
@@ -221,6 +221,29 @@ class ReadXmlElementTests(object):
])
])
assert_equal(expected_result, table)
+
+
+ @istest
+ def gridspan_is_read_as_colspan_for_table_cell(self):
+ element = xml_element("w:tbl", {}, [
+ xml_element("w:tr", {}, [
+ xml_element("w:tc", {}, [
+ xml_element("w:tcPr", {}, [
+ xml_element("w:gridSpan", {"w:val": "2"})
+ ]),
+ xml_element("w:p", {}, [])
+ ]),
+ ]),
+ ])
+ table = _read_and_get_document_xml_element(element)
+ expected_result = documents.table([
+ documents.table_row([
+ documents.table_cell([
+ documents.paragraph([])
+ ], colspan=2)
+ ])
+ ])
+ assert_equal(expected_result, table)
@istest