[Erp5-report] r31210 nicolas - /erp5/trunk/products/ERP5OOo/tests/testFormPrintout.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Dec 10 10:29:42 CET 2009


Author: nicolas
Date: Thu Dec 10 10:29:41 2009
New Revision: 31210

URL: http://svn.erp5.org?rev=31210&view=rev
Log:
Improve test to avoid regression regarding style of table cells

Modified:
    erp5/trunk/products/ERP5OOo/tests/testFormPrintout.py

Modified: erp5/trunk/products/ERP5OOo/tests/testFormPrintout.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testFormPrintout.py?rev=31210&r1=31209&r2=31210&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testFormPrintout.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testFormPrintout.py [utf8] Thu Dec 10 10:29:41 2009
@@ -558,8 +558,14 @@
     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




More information about the Erp5-report mailing list