tostring.escape : optimization

use of xml.etree.ElementTree._escape_attrib and xml.etree.ElementTree._escape_cdata
This commit is contained in:
Jean-Philippe Caruana
2013-07-30 18:51:23 +02:00
parent 88e64dbfae
commit c02adbb8e1
2 changed files with 22 additions and 30 deletions

View File

@@ -34,8 +34,7 @@ class TestToString(SleekTest):
desired = """<foo bar="baz">'Hi"""
desired += """ & welcome!'</foo>"""
self.failUnless(escaped == desired,
"XML escaping did not work: %s." % escaped)
self.assertEqual(escaped, desired)
def testEmptyElement(self):
"""Test converting an empty element to a string."""