summaryrefslogtreecommitdiff
path: root/bs4/tests/test_tree.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2013-05-20 10:20:40 -0400
committerLeonard Richardson <leonardr@segfault.org>2013-05-20 10:20:40 -0400
commita4d113a2f6648d7f97d29bbbd2634949a4050eb0 (patch)
treed74845850aa94bb8899ae175fe32a6ec08321e1a /bs4/tests/test_tree.py
parent9f370bad91d80570a57156f53c6a9efc918ff90f (diff)
Gave new_string() the ability to create subclasses of
NavigableString. [bug=1181986]
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r--bs4/tests/test_tree.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
index 4f12d20..c39b3f7 100644
--- a/bs4/tests/test_tree.py
+++ b/bs4/tests/test_tree.py
@@ -689,6 +689,12 @@ class TestTagCreation(SoupTest):
self.assertEqual("foo", s)
self.assertTrue(isinstance(s, NavigableString))
+ def test_new_string_can_create_navigablestring_subclass(self):
+ soup = self.soup("")
+ s = soup.new_string("foo", Comment)
+ self.assertEqual("foo", s)
+ self.assertTrue(isinstance(s, Comment))
+
class TestTreeModification(SoupTest):
def test_attribute_modification(self):