mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-19 11:52:18 -06:00
[MIG] document_page: Migration to 9.0
This commit is contained in:
committed by
FernandoRomera
parent
705b5194a0
commit
e660a86201
37
document_page/tests/test_document_page.py
Normal file
37
document_page/tests/test_document_page.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.tests import common
|
||||
|
||||
|
||||
class TestDocumentPage(common.TransactionCase):
|
||||
"""document_page test class."""
|
||||
|
||||
def test_page_creation(self):
|
||||
"""Test page creation."""
|
||||
parent_page = self.env.ref('document_page.demo_category1')
|
||||
|
||||
self.assertEqual(parent_page.name, 'OpenERP Features')
|
||||
|
||||
record = self.env['document.page'].create({
|
||||
'name': 'Test Page1',
|
||||
'parent_id': parent_page.id,
|
||||
'content': 'Test content'
|
||||
})
|
||||
self.assertEqual(record.name, 'Test Page1')
|
||||
|
||||
def test_category_display_content(self):
|
||||
"""Test category display content."""
|
||||
page = self.env.ref('document_page.demo_category1')
|
||||
self.assertTrue(page.display_content.find('Demo') > 1)
|
||||
|
||||
def test_page_display_content(self):
|
||||
"""Test page display content."""
|
||||
page = self.env.ref('document_page.demo_page1')
|
||||
self.assertTrue(page.display_content.find('Demo') > 1)
|
||||
|
||||
def test_page_do_set_content(self):
|
||||
"""Test page set content."""
|
||||
page = self.env.ref('document_page.demo_page1')
|
||||
page.content = None
|
||||
page.do_set_content()
|
||||
self.assertTrue(page.display_content.find('Summary') == 1)
|
||||
Reference in New Issue
Block a user