| 1557 | class TestNavigableStringSubclasses(SoupTest): |
| 1558 | |
| 1559 | def test_cdata(self): |
| 1560 | # None of the current builders turn CDATA sections into CData |
| 1561 | # objects, but you can create them manually. |
| 1562 | soup = self.soup("") |
| 1563 | cdata = CData("foo") |
| 1564 | soup.insert(1, cdata) |
| 1565 | self.assertEqual(str(soup), "<![CDATA[foo]]>") |
| 1566 | self.assertEqual(soup.find(text="foo"), "foo") |
| 1567 | self.assertEqual(soup.contents[0], "foo") |
| 1568 | |
| 1569 | def test_cdata_is_never_formatted(self): |
| 1570 | """Text inside a CData object is passed into the formatter. |