From d9c95565a7db3272f1e7337eca5234ab0d64dfd2 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Wed, 29 Dec 2010 20:23:24 -0500 Subject: Added a test to ensure that you can search for a Unicode string. --- src/beautifulsoup/tests/test_tree.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/beautifulsoup/tests/test_tree.py') diff --git a/src/beautifulsoup/tests/test_tree.py b/src/beautifulsoup/tests/test_tree.py index 1e87be0..191ec59 100644 --- a/src/beautifulsoup/tests/test_tree.py +++ b/src/beautifulsoup/tests/test_tree.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """Tests for Beautiful Soup's tree traversal methods. The tree traversal methods are the main advantage of using Beautiful @@ -33,6 +34,14 @@ class TreeTest(SoupTest): self.assertEqual([tag['id'] for tag in tags], should_match) +class TestFind(TreeTest): + """Basic tests of the find() method.""" + + def test_unicode_text_find(self): + soup = self.soup(u'

Räksmörgås

') + self.assertEqual(soup.find(text=u'Räksmörgås'), u'Räksmörgås') + + class TestFindAll(TreeTest): """Basic tests of the findAll() method.""" -- cgit v1.2.3