From 4eef28adde8d1b09dda10b1f6c4f8f896a2b9393 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sat, 26 Sep 2020 11:18:12 -0400 Subject: Fixed a bug that inconsistently moved elements over when passing a Tag, rather than a list, into Tag.extend(). [bug=1885710] --- bs4/tests/test_tree.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bs4/tests/test_tree.py') diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index 7981130..2246346 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -1009,6 +1009,15 @@ class TestTreeModification(SoupTest): soup.a.extend(l) self.assertEqual("", soup.decode()) + def test_extend_with_another_tags_contents(self): + data = '
1234
' + soup = self.soup(data) + d1 = soup.find('div', id='d1') + d2 = soup.find('div', id='d2') + d2.extend(d1) + self.assertEqual(u'
', d1.decode()) + self.assertEqual(u'
1234
', d2.decode()) + def test_move_tag_to_beginning_of_parent(self): data = "" soup = self.soup(data) -- cgit v1.2.3