# HG changeset patch # User Sylvain Thénault # Date 1253555387 -7200 # Node ID 5aed5d6cd5d0a52f081813cf4ab65a84b659f84f # Parent 9ca73fbd3a58403412bc3ef596ae01d6604c952d# Parent 83aabc5e3de3308a461aab33ff04c0ed73853ac8 merge diff -r 9ca73fbd3a58 -r 5aed5d6cd5d0 common/uilib.py --- a/common/uilib.py Mon Sep 21 19:49:21 2009 +0200 +++ b/common/uilib.py Mon Sep 21 19:49:47 2009 +0200 @@ -115,7 +115,7 @@ try: from lxml import etree except (ImportError, AttributeError): - # gae environment: lxml not availabel + # gae environment: lxml not available pass else: diff -r 9ca73fbd3a58 -r 5aed5d6cd5d0 test/unittest_entity.py --- a/test/unittest_entity.py Mon Sep 21 19:49:21 2009 +0200 +++ b/test/unittest_entity.py Mon Sep 21 19:49:47 2009 +0200 @@ -356,6 +356,18 @@ e['content'] = u'C'est un exemple sérieux' self.assertEquals(tidy(e.printable_value('content')), u"C'est un exemple sérieux") + e['content'] = u'
ms orifice produces weird html
' + self.assertEquals(tidy(e.printable_value('content')), + u'
ms orifice produces weird html
') + import tidy as tidymod # apt-get install python-tidy + tidy = lambda x: str(tidymod.parseString(x.encode('utf-8'), + **{'drop_proprietary_attributes': True, + 'output_xhtml': True, + 'show_body_only' : True, + 'quote-nbsp' : False, + 'char_encoding' : 'utf8'})).decode('utf-8').strip() + self.assertEquals(tidy(e.printable_value('content')), + u'
ms orifice produces weird html
') # make sure valid xhtml is left untouched e['content'] = u'
R&D
' self.assertEquals(e.printable_value('content'), e['content'])