summaryrefslogtreecommitdiff
path: root/bs4/tests/test_tree.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2015-06-25 21:27:49 -0400
committerLeonard Richardson <leonardr@segfault.org>2015-06-25 21:27:49 -0400
commit51044d613cc782d883a6eb3cd0d3dc391e13c23b (patch)
tree3f832763747aef89ac6e12503e538ebb047747f0 /bs4/tests/test_tree.py
parent89a4bcc0e1053ff75cd22e6dba8edc8eff387385 (diff)
The text argument to the find_* methods is now called string,
which is more accurate. text still works, but is the argument described in the documentation. text may eventually change its meaning, but not for a very long time. [bug=1366856]
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r--bs4/tests/test_tree.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
index 0bd4713..9e2982a 100644
--- a/bs4/tests/test_tree.py
+++ b/bs4/tests/test_tree.py
@@ -70,7 +70,7 @@ class TestFind(TreeTest):
def test_unicode_text_find(self):
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')
+ self.assertEqual(soup.find(string=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>')
@@ -95,6 +95,7 @@ class TestFindAll(TreeTest):
"""You can search the tree for text nodes."""
soup = self.soup("<html>Foo<b>bar</b>\xbb</html>")
# Exact match.
+ self.assertEqual(soup.find_all(string="bar"), [u"bar"])
self.assertEqual(soup.find_all(text="bar"), [u"bar"])
# Match any of a number of strings.
self.assertEqual(