diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 10:39:30 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 10:39:30 -0500 |
commit | f2532b1d63bd4a4d2be6ad9a4dce5eea03f43e7a (patch) | |
tree | 60bd21949b54bdb5588ecce31a3bb89e40617692 /tests/test_lxml.py | |
parent | b3ba2b97b2d4c4e5559baadc96f1844753b38df4 (diff) |
Since we can't parse in CData objects ATM, added a test for CData objects created manually, to keep the bits from rotting.
Diffstat (limited to 'tests/test_lxml.py')
-rw-r--r-- | tests/test_lxml.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_lxml.py b/tests/test_lxml.py index c178457..88c866d 100644 --- a/tests/test_lxml.py +++ b/tests/test_lxml.py @@ -518,6 +518,17 @@ class TestLXMLXMLBuilder(SoupTest): def default_builder(self): return LXMLTreeBuilderForXML() + def test_cdata_becomes_text(self): + # LXML sends CData sections as 'data' events, so we can't + # create special CData objects for them. We have to use + # NavigableString. I would like to fix this, but it's not a + # very high priority. + markup = "<foo><![CDATA[iamcdata]]></foo>" + soup = self.soup(markup) + cdata = soup.foo.contents[0] + self.assertEquals(cdata.__class__.__name__, 'NavigableString') + + def test_can_handle_invalid_xml(self): self.assertSoupEquals("<a><b>", "<a><b /></a>") |