diff options
-rw-r--r-- | src/beautifulsoup/tests/test_soup.py | 6 | ||||
-rw-r--r-- | src/beautifulsoup/tests/test_tree.py | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/beautifulsoup/tests/test_soup.py b/src/beautifulsoup/tests/test_soup.py index c5b08bb..66f05ae 100644 --- a/src/beautifulsoup/tests/test_soup.py +++ b/src/beautifulsoup/tests/test_soup.py @@ -66,3 +66,9 @@ class TestUnicodeDammit(unittest.TestCase): dammit = UnicodeDammit(hebrew, ["iso-8859-8"]) self.assertEquals(dammit.originalEncoding, 'iso-8859-8') self.assertEquals(dammit.unicode, u'\u05dd\u05d5\u05dc\u05e9') + + def test_dont_see_smart_quotes_where_there_are_none(self): + utf_8 = "\343\202\261\343\203\274\343\202\277\343\202\244 Watch" + dammit = UnicodeDammit(utf_8) + self.assertEquals(dammit.originalEncoding, 'utf-8') + self.assertEquals(dammit.unicode.encode("utf-8"), utf_8) 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'<h1>Räksmörgås</h1>') + self.assertEqual(soup.find(text=u'Räksmörgås'), u'Räksmörgås') + + class TestFindAll(TreeTest): """Basic tests of the findAll() method.""" |