diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-13 18:04:03 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-13 18:04:03 -0500 |
commit | 4191d5ff45015c6fac1db0bbdd7b3fcaff234424 (patch) | |
tree | 9ea55039f365a6f62f7bff751be730ce8f75398a /tests/test_lxml.py | |
parent | 84d7f8dd319039d385b9afe1da751006be2c9859 (diff) |
Clarified lxml's behavior w/r/t CDATA sections.
Diffstat (limited to 'tests/test_lxml.py')
-rw-r--r-- | tests/test_lxml.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_lxml.py b/tests/test_lxml.py index 207d141..8f36b41 100644 --- a/tests/test_lxml.py +++ b/tests/test_lxml.py @@ -196,16 +196,17 @@ class TestLXMLBuilder(SoupTest): soup = self.soup("<a> </a>") self.assertEquals(soup.a.string, u"\N{NO-BREAK SPACE}" * 2) + def test_cdata_where_its_ok(self): + # lxml strips CDATA sections, no matter where they occur. + markup = "<svg><![CDATA[foobar]]>" + self.assertSoupEquals(markup, "<svg></svg>") + # Tests below this line need work. #def test_doctype(self): # xml = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"><html>foo</html></p>' # self.assertSoupEquals(xml) - - #def test_cdata(self): - # print self.soup("<div><![CDATA[foo]]></div>") - def test_entities_converted_on_the_way_out(self): text = "<p><<sacré bleu!>></p>" expected = u"<<sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>".encode("utf-8") |