mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-24 17:38:42 -06:00
test improved
This commit is contained in:
parent
878f2d686c
commit
432d141ce0
@ -1,2 +1,3 @@
|
|||||||
"""Module test initialisation."""
|
"""Module test initialisation."""
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
from . import test_document_page_approval
|
||||||
|
@ -1,16 +1,35 @@
|
|||||||
"""DocumentPageApproval test."""
|
"""DocumentPageApproval test."""
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from openerp.test.common import TransactionCase
|
from openerp.tests import common
|
||||||
|
|
||||||
|
|
||||||
class TestDocumentPageApproval(TransactionCase):
|
class TestDocumentPageApproval(common.TransactionCase):
|
||||||
"""Test document page approval model."""
|
"""Test document page approval model."""
|
||||||
|
|
||||||
def setUp(self):
|
def test_get_display_content(self):
|
||||||
"""Test setUp."""
|
"""Test page display content."""
|
||||||
super()
|
# Check content of a category
|
||||||
pass
|
category = self.env['document.page'].search(
|
||||||
|
[('name', '=', 'OpenERP Features')])
|
||||||
|
|
||||||
def __init__(self, arg):
|
self.assertIsNotNone(category.display_content, 'a category')
|
||||||
"""Test initialisation."""
|
|
||||||
pass
|
# 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.assertFalse(page.is_approval_required(page))
|
||||||
|
|
||||||
|
# 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.assertFalse(page.is_parent_approval_required)
|
||||||
|
Loading…
Reference in New Issue
Block a user