Commit 39f0eb0b authored by Nicolas Delaby's avatar Nicolas Delaby

Improve test to avoid regression regarding style of table cells

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31210 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1d26235c
......@@ -558,8 +558,14 @@ class TestFormPrintout(ERP5TypeTestCase):
self.assertTrue(odf_document is not None)
builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml")
content_tree = etree.XML(content_xml)
#Check that foo_1 is inside table, with the same style
xpath_style_name_expression = '//table:table[@table:name="listbox2"]/table:table-row/table:table-cell/text:p[@text:style-name="P4"]/text()'
self.assertEquals(['foo_1', 'foo_2'], content_tree.xpath(xpath_style_name_expression, namespaces=content_tree.nsmap))
#Check that each listbox values are inside ODT table cells
xpath_result_expression = '//table:table[@table:name="listbox2"]/table:table-row/table:table-cell/text:p/text()'
self.assertEquals(['foo_1', 'foo_title_5', 'foo_2', 'foo_2', '1234.5'], content_tree.xpath(xpath_result_expression, namespaces=content_tree.nsmap))
self.assertFalse(content_xml.find("foo_title_4") > 0)
self.assertTrue(content_xml.find("foo_title_5") > 0)
self._validate(odf_document)
# put back the field name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment