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:
flachica
2020-07-04 19:13:10 +02:00
committed by Bhavesh Heliconia
parent 8d8c8ac32a
commit cd6a16d839
8 changed files with 27 additions and 37 deletions

View File

@@ -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")]