diff -r b8bd0ecced2e -r eeedb3575d25 test/unittest_uilib.py --- a/test/unittest_uilib.py Fri Nov 05 14:28:22 2010 +0100 +++ b/test/unittest_uilib.py Fri Oct 22 16:14:48 2010 +0200 @@ -20,10 +20,16 @@ __docformat__ = "restructuredtext en" + +import pkg_resources from logilab.common.testlib import TestCase, unittest_main +from unittest2 import skipIf from cubicweb import uilib +lxml_version = pkg_resources.get_distribution('lxml').version.split('.') + + class UILIBTC(TestCase): def test_remove_tags(self): @@ -91,7 +97,15 @@ got = uilib.text_cut(text, 30) self.assertEqual(got, expected) + def test_soup2xhtml_0(self): + self.assertEqual(uilib.soup2xhtml('hop\r\nhop', 'ascii'), + 'hop\nhop') + def test_soup2xhtml_1_1(self): + self.assertEqual(uilib.soup2xhtml('hop', 'ascii'), + 'hop') + self.assertEqual(uilib.soup2xhtml('hop