mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-19 03:42:19 -06:00
Migrate to 13.0 document_page_approval
To pass test is necesary set approval required to False in demo data
This commit is contained in:
committed by
Bhavesh Heliconia
parent
8d8c8ac32a
commit
cd6a16d839
@@ -12,9 +12,7 @@ class TestDocumentPageApproval(common.TransactionCase):
|
||||
self.approver_gid = self.env.ref(
|
||||
"document_page_approval.group_document_approver_user"
|
||||
)
|
||||
self.env.ref("base.user_root").write(
|
||||
{"groups_id": [(4, self.approver_gid.id)],}
|
||||
)
|
||||
self.env.ref("base.user_root").write({"groups_id": [(4, self.approver_gid.id)]})
|
||||
# demo_approval
|
||||
self.category2 = self.page_obj.create(
|
||||
{
|
||||
@@ -46,6 +44,9 @@ class TestDocumentPageApproval(common.TransactionCase):
|
||||
|
||||
# It should automatically be in 'to approve' state
|
||||
self.assertEqual(chreq.state, "to approve")
|
||||
|
||||
# Needed to compute calculated fields
|
||||
page.refresh()
|
||||
self.assertNotEqual(chreq.content, page.content)
|
||||
|
||||
# who_am_i
|
||||
@@ -59,6 +60,8 @@ class TestDocumentPageApproval(common.TransactionCase):
|
||||
|
||||
# new changes should create change requests
|
||||
page.write({"content": "New content"})
|
||||
# Needed to compute calculated fields
|
||||
page.refresh()
|
||||
self.assertNotEqual(page.content, "New content")
|
||||
chreq = self.history_obj.search(
|
||||
[("page_id", "=", page.id), ("state", "!=", "approved")]
|
||||
|
||||
Reference in New Issue
Block a user