mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-20 02:06:45 -06:00
test error fixed
This commit is contained in:
parent
00788554f4
commit
ed644b621d
@ -1,2 +1,2 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
document_page_history,document.page.history,model_document_page_history,base.group_document_approver_user,1,1,1,0
|
document_page_history,document.page.history,model_document_page_history,group_document_approver_user,1,1,1,0
|
||||||
|
|
@ -12,30 +12,25 @@ class TestDocumentPageHistoryWorkflow(common.TransactionCase):
|
|||||||
|
|
||||||
def test_can_user_approve_this_page(self):
|
def test_can_user_approve_this_page(self):
|
||||||
"""Test if a user can approve this page."""
|
"""Test if a user can approve this page."""
|
||||||
group = self.env['res.groups'].search([
|
|
||||||
('name', '=', 'Document approver')
|
|
||||||
])
|
|
||||||
category = self.env.ref('document_page.demo_category1')
|
category = self.env.ref('document_page.demo_category1')
|
||||||
category.approval_required = True
|
category.approval_required = True
|
||||||
category.approver_uid = group
|
category.approver_gid = self.env.ref('document_page_approval.group_document_approver_user')
|
||||||
|
|
||||||
page = self.env['document.page'].create({
|
page = self.env['document.page'].create({
|
||||||
'name': 'Test Page10',
|
'name': 'Test Page10',
|
||||||
|
'content': 'A difficult test',
|
||||||
'parent_id': category.id
|
'parent_id': category.id
|
||||||
})
|
})
|
||||||
|
|
||||||
# history = self.env['document.page.history']
|
history = self.env['document.page.history'].search(
|
||||||
# history_ids = history.search(
|
[
|
||||||
# [
|
('page_id', '=', page.id)
|
||||||
# ('page_id', '=', page.id)
|
],
|
||||||
# ],
|
limit=1,
|
||||||
# limit=1,
|
order='create_date DESC'
|
||||||
# order='create_date DESC'
|
)
|
||||||
#)
|
|
||||||
#history_ids.signal_workflow('page_approval_draft')
|
self.assertTrue(history.can_user_approve_page)
|
||||||
#state = history_ids.state == 'draft'
|
|
||||||
# state = history_ids[0].page_id == page.id
|
|
||||||
self.assertTrue(page.is_approval_required(page))
|
|
||||||
|
|
||||||
def test_get_approvers_guids(self):
|
def test_get_approvers_guids(self):
|
||||||
"""Get approver guids."""
|
"""Get approver guids."""
|
||||||
|
Loading…
Reference in New Issue
Block a user