mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-19 03:42:19 -06:00
[MIG] document_page_approval: Migration to 9.0
* Lint error corrected * test improved * lint error corrected in test file * readme corrected * test improved * test of document page history workflow added * CI error corrected * dreipst comment * Migration to new api improved in model's file and data tag remove in xml file * code totally migrate to odoo 9.0 api * test bug fixed * test error fixed * Lint error improved
This commit is contained in:
committed by
FernandoRomera
parent
08540fc1b0
commit
1c1c55ba3d
37
document_page_approval/tests/test_document_page_approval.py
Normal file
37
document_page_approval/tests/test_document_page_approval.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from openerp.tests import common
|
||||
|
||||
|
||||
class TestDocumentPageApproval(common.TransactionCase):
|
||||
"""Test document page approval model."""
|
||||
|
||||
def test_get_display_content(self):
|
||||
"""Test page display content."""
|
||||
# Check content of a category
|
||||
category = self.env['document.page'].search([
|
||||
('name', '=', 'OpenERP Features')
|
||||
])
|
||||
|
||||
self.assertIsNotNone(category.display_content, 'a category')
|
||||
|
||||
# Check content of a page
|
||||
pages = self.env['document.page'].search([
|
||||
('parent_id', '=', category.id)
|
||||
])
|
||||
page = pages[0]
|
||||
self.assertIsNotNone(page.display_content, 'Page content')
|
||||
|
||||
# Check if approval is required
|
||||
self.assertTrue(page.is_approval_required(page) ==
|
||||
category.approval_required)
|
||||
|
||||
# Check content of an approval page
|
||||
page.approval_required = True
|
||||
|
||||
self.assertIsNotNone(page.display_content, 'Page content')
|
||||
|
||||
# Check if approval is required
|
||||
self.assertTrue(page.is_approval_required(page))
|
||||
|
||||
# Check if parent approval is required
|
||||
self.assertTrue(page.is_parent_approval_required)
|
||||
Reference in New Issue
Block a user