summaryrefslogtreecommitdiff
path: root/tests/test_tree.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_tree.py')
-rw-r--r--tests/test_tree.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/test_tree.py b/tests/test_tree.py
index 6f00716..384d518 100644
--- a/tests/test_tree.py
+++ b/tests/test_tree.py
@@ -524,14 +524,15 @@ class TestTreeModification(SoupTest):
def test_new_tag_creation(self):
builder = BeautifulSoup.default_builder()
- soup = self.soup("", builder=builder)
+ soup = self.soup("<body></body>", builder=builder)
a = Tag(soup, builder, 'a')
ol = Tag(soup, builder, 'ol')
a['href'] = 'http://foo.com/'
- soup.insert(0, a)
- soup.insert(1, ol)
+ soup.body.insert(0, a)
+ soup.body.insert(1, ol)
self.assertEqual(
- soup.decode(), '<a href="http://foo.com/"></a><ol></ol>')
+ soup.body.encode(),
+ '<body><a href="http://foo.com/"></a><ol></ol></body>')
def test_append_to_contents_moves_tag(self):
doc = """<p id="1">Don't leave me <b>here</b>.</p>
@@ -866,7 +867,6 @@ class TestSubstitutions(SoupTest):
self.assertEquals(soup.contents[0].name, 'pre')
-
class TestEncoding(SoupTest):
"""Test the ability to encode objects into strings."""
@@ -885,7 +885,6 @@ class TestEncoding(SoupTest):
class TestNavigableStringSubclasses(SoupTest):
-
def test_cdata(self):
# None of the current builders turn CDATA sections into CData
# objects, but you can create them manually.