summaryrefslogtreecommitdiff
path: root/tests/test_lxml.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-02-19 21:16:20 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2011-02-19 21:16:20 -0500
commit86ae2ed0a644f124475a4aff3b34e229f5b7ec8f (patch)
tree339d0a5724f97c1c406b3aaca042e8341c33fd3d /tests/test_lxml.py
parente170ff33e67e806cf33e2e51fcefcfa0b9310d96 (diff)
Set up an lxml parser that only parses XML, though it's not very functional yet.
Diffstat (limited to 'tests/test_lxml.py')
-rw-r--r--tests/test_lxml.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_lxml.py b/tests/test_lxml.py
index 7e15dcf..7597552 100644
--- a/tests/test_lxml.py
+++ b/tests/test_lxml.py
@@ -131,7 +131,7 @@ class TestLXMLBuilder(SoupTest):
# But, both lxml and html5lib do their best to parse the
# contents of a <textarea> as HTML.
text = '<textarea>Junk like <b> tags and <&<&amp;</textarea>'
- soup = BeautifulSoup(text)
+ soup = self.soup(text)
self.assertEquals(len(soup.textarea.contents), 2)
self.assertEquals(soup.textarea.contents[0], u"Junk like ")
self.assertEquals(soup.textarea.contents[1].name, 'b')
@@ -141,7 +141,7 @@ class TestLXMLBuilder(SoupTest):
# The contents of a <script> tag are treated as a literal string,
# even if that string contains HTML.
javascript = 'if (i < 2) { alert("<b>foo</b>"); }'
- soup = BeautifulSoup('<script>%s</script>' % javascript)
+ soup = self.soup('<script>%s</script>' % javascript)
self.assertEquals(soup.script.string, javascript)
def test_naked_ampersands(self):
@@ -300,7 +300,7 @@ class TestLXMLBuilder(SoupTest):
def test_entities_converted_on_the_way_out(self):
text = "<p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>"
expected = u"&lt;&lt;sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;".encode("utf-8")
- soup = BeautifulSoup(text)
+ soup = self.soup(text)
str = soup.p.string
#self.assertEquals(str.encode("utf-8"), expected)