fix(tests): Update more tests to conform with nh3 behaviour
This commit is contained in:
parent
a5ef0104f1
commit
8a82699640
2 changed files with 3 additions and 2 deletions
|
|
@ -262,6 +262,7 @@ class TestDocument(IntegrationTestCase):
|
|||
|
||||
def test_xss_filter(self):
|
||||
d = self.test_insert()
|
||||
subject = d.subject
|
||||
|
||||
# script
|
||||
xss = '<script>alert("XSS")</script>'
|
||||
|
|
@ -271,7 +272,7 @@ class TestDocument(IntegrationTestCase):
|
|||
d.reload()
|
||||
|
||||
self.assertTrue(xss not in d.subject)
|
||||
self.assertTrue(escaped_xss in d.subject)
|
||||
self.assertEqual(subject, d.subject)
|
||||
|
||||
# onload
|
||||
xss = '<div onload="alert("XSS")">Test</div>'
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ class TestHTMLUtils(IntegrationTestCase):
|
|||
sample = """<h1>Hello</h1><p>Para</p><a href="http://test.com">text</a>"""
|
||||
clean = clean_email_html(sample)
|
||||
self.assertTrue("<h1>Hello</h1>" in clean)
|
||||
self.assertTrue('<a href="http://test.com">text</a>' in clean)
|
||||
self.assertTrue('<a href="http://test.com" rel="noopener noreferrer">text</a>' in clean)
|
||||
|
||||
def test_sanitize_html(self):
|
||||
from frappe.utils.html_utils import sanitize_html
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue