summaryrefslogtreecommitdiff
path: root/bs4/tests/test_tree.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-15 14:27:21 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-15 14:27:21 -0500
commita06152365c336f41bdb5fb9513b9316740c1564a (patch)
tree72f7f6993624453d8f4a8ccc21ef88ef93cee59a /bs4/tests/test_tree.py
parentbe0c08585f54ec709740ff4352006bf3e605b8f2 (diff)
Some cdata-list attributes are only cdata lists for certain tags.
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r--bs4/tests/test_tree.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
index 2e74c00..8e61429 100644
--- a/bs4/tests/test_tree.py
+++ b/bs4/tests/test_tree.py
@@ -1065,6 +1065,15 @@ class TestCDAtaListAttributes(SoupTest):
soup = self.soup('<form accept-charset="ISO-8859-1 UTF-8">')
self.assertEqual(['ISO-8859-1', 'UTF-8'], soup.form['accept-charset'])
+ def test_cdata_attribute_applying_only_to_one_tag(self):
+ data = '<a accept-charset="ISO-8859-1 UTF-8"></a>'
+ soup = self.soup(data)
+ # We saw in another test that accept-charset is a cdata-list
+ # attribute for the <form> tag. But it's not a cdata-list
+ # attribute for any other tag.
+ self.assertEquals('ISO-8859-1 UTF-8', soup.a['accept-charset'])
+
+
class TestPersistence(SoupTest):
"Testing features like pickle and deepcopy."