mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-22 13:22:19 -06:00
[14.0][FIX] document_page: Stored XSS
unitary tests added post-migration script added
This commit is contained in:
@@ -62,18 +62,18 @@ class TestDocumentPageApproval(common.TransactionCase):
|
||||
page.write({"content": "New content"})
|
||||
# Needed to compute calculated fields
|
||||
page.refresh()
|
||||
self.assertNotEqual(page.content, "New content")
|
||||
self.assertNotEqual(page.content, "<p>New content</p>")
|
||||
chreq = self.history_obj.search(
|
||||
[("page_id", "=", page.id), ("state", "!=", "approved")]
|
||||
)[0]
|
||||
chreq.action_approve()
|
||||
self.assertEqual(page.content, "New content")
|
||||
self.assertEqual(page.content, "<p>New content</p>")
|
||||
|
||||
def test_change_request_auto_approve(self):
|
||||
page = self.page1
|
||||
self.assertFalse(page.is_approval_required)
|
||||
page.write({"content": "New content"})
|
||||
self.assertEqual(page.content, "New content")
|
||||
self.assertEqual(page.content, "<p>New content</p>")
|
||||
|
||||
def test_change_request_from_scratch(self):
|
||||
page = self.page2
|
||||
@@ -88,7 +88,7 @@ class TestDocumentPageApproval(common.TransactionCase):
|
||||
{
|
||||
"page_id": page.id,
|
||||
"summary": "Changed something",
|
||||
"content": "New content",
|
||||
"content": "<p>New content</p>",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user