Skip to content

Commit

Permalink
Merge pull request #68 from plone/do_not_autoclose_tags
Browse files Browse the repository at this point in the history
Fix test after PortalTransforms uses lxml html method to serialize (instead of xml method).
  • Loading branch information
mauritsvanrees authored Mar 15, 2022
2 parents 7851f04 + 3436e32 commit 9a4e80e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Products/ATContentTypes/tests/test_atdocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,15 @@ def test_x_safe_html(self):
doc = self._ATCT
mimetypes = (
('text/html', '<p>test</p>'),
# MTR doens't know about text/stx, and transforming
# MTR does not know about text/stx, and transforming
# doubles the tags. Yuck.
('text/structured', '<p><p>test</p></p>\n'),
('text/structured', '<p></p><p>test</p>\n'),
)
for mimetype, expected in mimetypes:
# scrub html is removing unallowed tags
text = "<p>test</p><script>I'm a nasty boy<p>nested</p></script>"
doc.setText(text, mimetype=mimetype)
txt = doc.getText()
# fix for lxml based safe HTML cleaner
# nested p-tags are not allowed and therefore removed
# put expected string to mimetypes tuple above and remove condition
# once PLIP 1441 is merged.
if '<p/>' in txt:
expected = '<p/><p>test</p>\n'
self.assertEqual(txt, expected, (txt, expected, mimetype))

def test_get_size(self):
Expand Down

0 comments on commit 9a4e80e

Please sign in to comment.