From 81b0e7160db445f9d8fb8bf09ba306df87cac19e Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Tue, 23 Jun 2015 19:50:23 -0400 Subject: Force object_was_parsed() to keep the tree intact even when an element from later in the document is moved into place. [bug=1430633] --- bs4/tests/test_tree.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bs4/tests/test_tree.py') diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index c9d1dcd..cb3897b 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -70,6 +70,12 @@ class TestFind(TreeTest): soup = self.soup(u'

Räksmörgås

') self.assertEqual(soup.find(text=u'Räksmörgås'), u'Räksmörgås') + def test_unicode_attribute_find(self): + soup = self.soup(u'

here it is

') + str(soup) + self.assertEqual("here it is", soup.find(id=u'Räksmörgås').text) + + def test_find_everything(self): """Test an optimization that finds all tags.""" soup = self.soup("foobar") -- cgit v1.2.3