diff options
author | Leonard Richardson <leonardr@segfault.org> | 2015-06-23 19:50:23 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2015-06-23 19:50:23 -0400 |
commit | 81b0e7160db445f9d8fb8bf09ba306df87cac19e (patch) | |
tree | 49e28714198e01fbf1c96ff717d3a1bcbf569f20 /bs4/tests/test_tree.py | |
parent | 5bd09164de9b5a45ffea4171968b8186dcdc6f69 (diff) |
Force object_was_parsed() to keep the tree intact even when an element
from later in the document is moved into place. [bug=1430633]
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r-- | bs4/tests/test_tree.py | 6 |
1 files changed, 6 insertions, 0 deletions
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'<h1>Räksmörgås</h1>') 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'<h1 id="Räksmörgås">here it is</h1>') + 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("<a>foo</a><b>bar</b>") |