(self)
| 855 | self.assertEqual(new_text.next_element, soup.c) |
| 856 | |
| 857 | def test_insert_string(self): |
| 858 | soup = self.soup("<a></a>") |
| 859 | soup.a.insert(0, "bar") |
| 860 | soup.a.insert(0, "foo") |
| 861 | # The string were added to the tag. |
| 862 | self.assertEqual(["foo", "bar"], soup.a.contents) |
| 863 | # And they were converted to NavigableStrings. |
| 864 | self.assertEqual(soup.a.contents[0].next_element, "bar") |
| 865 | |
| 866 | def test_insert_tag(self): |
| 867 | builder = self.default_builder |