[test] fixes to make tests pass with recent lxml
authorDavid Douard <david.douard@logilab.fr>
Thu, 11 Dec 2014 15:02:23 +0100
changeset 10116 4e9738f5c798
parent 10114 6f4b4567b77d
child 10117 bf962b760082
[test] fixes to make tests pass with recent lxml lxml (on jessie at least, ie. 3.4.0) does not remove endlines anymore.
test/unittest_entity.py
test/unittest_uilib.py
--- a/test/unittest_entity.py	Wed Dec 17 10:55:53 2014 +0100
+++ b/test/unittest_entity.py	Thu Dec 11 15:02:23 2014 +0100
@@ -590,8 +590,8 @@
     def test_printable_value_string(self):
         with self.admin_access.web_request() as req:
             e = req.create_entity('Card', title=u'rest test',
-                                       content=u'du :eid:`1:*ReST*`',
-                                       content_format=u'text/rest')
+                                  content=u'du :eid:`1:*ReST*`',
+                                  content_format=u'text/rest')
             self.assertEqual(e.printable_value('content'),
                              '<p>du <a class="reference" href="http://testing.fr/cubicweb/cwsource/system">*ReST*</a></p>')
             e.cw_attr_cache['content'] = 'du <em>html</em> <ref rql="CWUser X">users</ref>'
@@ -600,8 +600,8 @@
                               'du <em>html</em> <a href="http://testing.fr/cubicweb/view?rql=CWUser%20X">users</a>')
             e.cw_attr_cache['content'] = 'du *texte*'
             e.cw_attr_cache['content_format'] = 'text/plain'
-            self.assertEqual(e.printable_value('content'),
-                              '<p>\ndu *texte*<br/></p>')
+            self.assertEqual(e.printable_value('content').replace("\n", ""),
+                             '<p>du *texte*<br/></p>')
             e.cw_attr_cache['title'] = 'zou'
             e.cw_attr_cache['content'] = '''\
 a title
--- a/test/unittest_uilib.py	Wed Dec 17 10:55:53 2014 +0100
+++ b/test/unittest_uilib.py	Thu Dec 11 15:02:23 2014 +0100
@@ -178,9 +178,9 @@
         self.assertMultiLineEqual(uilib.soup2xhtml(incoming, 'ascii'), expected)
 
     def test_unknown_namespace(self):
-        incoming = '''<table cellspacing="0" cellpadding="0" width="81" border="0" x:str="" style="width: 61pt; border-collapse: collapse">
-<colgroup><col width="81" style="width: 61pt; mso-width-source: userset; mso-width-alt: 2962"/></colgroup>
-<tbody><tr height="17" style="height: 12.75pt"><td width="81" height="17" style="border-right: #e0dfe3; border-top: #e0dfe3; border-left: #e0dfe3; width: 61pt; border-bottom: #e0dfe3; height: 12.75pt; background-color: transparent"><font size="2">XXXXXXX</font></td></tr></tbody>
+        incoming = '''<table cellspacing="0" cellpadding="0" width="81" border="0" x:str="" style="width: 61pt; border-collapse: collapse">\
+<colgroup><col width="81" style="width: 61pt; mso-width-source: userset; mso-width-alt: 2962"/></colgroup>\
+<tbody><tr height="17" style="height: 12.75pt"><td width="81" height="17" style="border-right: #e0dfe3; border-top: #e0dfe3; border-left: #e0dfe3; width: 61pt; border-bottom: #e0dfe3; height: 12.75pt; background-color: transparent"><font size="2">XXXXXXX</font></td></tr></tbody>\
 </table>'''
         expected = '''<table cellspacing="0" cellpadding="0" width="81" border="0">\
 <colgroup><col width="81"/></colgroup>\