adding test for special html caractere
authorLaure Bourgois <Laure.Bourgois@logilab.fr>
Wed, 07 Jan 2009 10:47:00 +0100
changeset 343 50073bc6df5e
parent 338 25aae8a15532
child 344 e0d5879a613e
adding test for special html caractere
common/test/unittest_uilib.py
--- a/common/test/unittest_uilib.py	Tue Jan 06 12:53:47 2009 -0800
+++ b/common/test/unittest_uilib.py	Wed Jan 07 10:47:00 2009 +0100
@@ -10,7 +10,6 @@
 
 class UILIBTC(TestCase):
 
-
     def test_remove_tags(self):
         """make sure remove_tags remove all tags"""
         data = [
@@ -60,6 +59,13 @@
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur.</p>""","""<div><p>Lorem <strong>ipsum</strong> dolor <it>sit</it> amet, <strong>consectetur</strong></p></div>"""),
+            ("""&iexcl;""",u"""<div><p>\xa1</p></div>"""),
+            ("""<strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong>""",
+             u"""<div><strong>\xa1 \xa1 \xa1 \xa1</strong></div>"""),
+            ("""<strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong><strong>&iexcl; &iexcl; &iexcl; &iexcl;</strong>""",
+             u"""<div><strong>\xa1 \xa1 \xa1 \xa1</strong><strong>\xa1 \xa1 \xa1 \xa1</strong><strong>\xa1 \xa1 \xa1 \xa1</strong><strong>\xa1 \xa1 \xa1 \xa1</strong><strong>\xa1 \xa1 \xa1 \xa1</strong><strong>\xa1 \xa1 \xa1 \xa1</strong><strong>\xa1 \xa1 \xa1 \xa1</strong><strong>\xa1 \xa1 \xa1 \xa1</strong></div>"""),
+                      
+                       
             ]
         for text, expected in data:
             got = uilib.safe_cut(text, 30)