| 1583 | class TestNavigableStringSubclasses(SoupTest): |
| 1584 | |
| 1585 | def test_cdata(self): |
| 1586 | # None of the current builders turn CDATA sections into CData |
| 1587 | # objects, but you can create them manually. |
| 1588 | soup = self.soup("") |
| 1589 | cdata = CData("foo") |
| 1590 | soup.insert(1, cdata) |
| 1591 | self.assertEqual(str(soup), "<![CDATA[foo]]>") |
| 1592 | self.assertEqual(soup.find(text="foo"), "foo") |
| 1593 | self.assertEqual(soup.contents[0], "foo") |
| 1594 | |
| 1595 | def test_cdata_is_never_formatted(self): |
| 1596 | """Text inside a CData object is passed into the formatter. |