diff options
author | Leonard Richardson <leonardr@segfault.org> | 2018-07-30 20:19:51 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2018-07-30 20:19:51 -0400 |
commit | 71e6e49af92cc395c1896b845042fced8f6ed6a7 (patch) | |
tree | 19966cc326522e87cd974b51a36098e85927e2a7 /bs4/tests/test_tree.py | |
parent | b9d9a035157fea45b17201426f73a200b20814ef (diff) |
Fix an exception when a custom formatter was asked to format a void
element. [bug=1784408]
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r-- | bs4/tests/test_tree.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index 68887b4..883cd8a 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -1474,14 +1474,14 @@ class TestSubstitutions(SoupTest): self.document_for(u"<b><<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>></b>")) def test_formatter_custom(self): - markup = u"<b><foo></b><b>bar</b>" + markup = u"<b><foo></b><b>bar</b><br/>" soup = self.soup(markup) decoded = soup.decode(formatter = lambda x: x.upper()) # Instead of normal entity conversion code, the custom # callable is called on every string. self.assertEqual( decoded, - self.document_for(u"<b><FOO></b><b>BAR</b>")) + self.document_for(u"<b><FOO></b><b>BAR</b><br>")) def test_formatter_is_run_on_attribute_values(self): markup = u'<a href="http://a.com?a=b&c=é">e</a>' |