test/unittest_uilib.py
changeset 7569 02c338197322
parent 7568 c5ee33fb6a3b
child 8909 f46b017db2d9
equal deleted inserted replaced
7565:b355d9dd43df 7569:02c338197322
     1 # -*- coding: utf-8 -*-
     1 # -*- coding: utf-8 -*-
     2 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     3 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     4 #
     4 #
     5 # This file is part of CubicWeb.
     5 # This file is part of CubicWeb.
     6 #
     6 #
     7 # CubicWeb is free software: you can redistribute it and/or modify it under the
     7 # CubicWeb is free software: you can redistribute it and/or modify it under the
    20 
    20 
    21 __docformat__ = "restructuredtext en"
    21 __docformat__ = "restructuredtext en"
    22 
    22 
    23 
    23 
    24 import pkg_resources
    24 import pkg_resources
    25 from logilab.common.testlib import TestCase, unittest_main
    25 
    26 from unittest2 import skipIf
    26 from unittest2 import skipIf
       
    27 
       
    28 from logilab.common.testlib import DocTest, TestCase, unittest_main
    27 
    29 
    28 from cubicweb import uilib
    30 from cubicweb import uilib
    29 
    31 
    30 lxml_version = pkg_resources.get_distribution('lxml').version.split('.')
    32 lxml_version = pkg_resources.get_distribution('lxml').version.split('.')
    31 
       
    32 
    33 
    33 class UILIBTC(TestCase):
    34 class UILIBTC(TestCase):
    34 
    35 
    35     def test_remove_tags(self):
    36     def test_remove_tags(self):
    36         """make sure remove_tags remove all tags"""
    37         """make sure remove_tags remove all tags"""
   183 <tbody><tr height="17"><td width="81" height="17">XXXXXXX</td></tr></tbody>\
   184 <tbody><tr height="17"><td width="81" height="17">XXXXXXX</td></tr></tbody>\
   184 </table>'''
   185 </table>'''
   185         self.assertMultiLineEqual(uilib.soup2xhtml(incoming, 'ascii'), expected)
   186         self.assertMultiLineEqual(uilib.soup2xhtml(incoming, 'ascii'), expected)
   186 
   187 
   187 
   188 
       
   189 class DocTest(DocTest):
       
   190     module = uilib
       
   191 
       
   192 
   188 if __name__ == '__main__':
   193 if __name__ == '__main__':
   189     unittest_main()
   194     unittest_main()
   190 
   195