document_page: fix link

This commit is contained in:
Simone Orsi
2019-07-11 08:44:43 +02:00
committed by FernandoRomera
parent ebbf80ae89
commit 01e3a8c9ac
3 changed files with 40 additions and 2 deletions

View File

@@ -37,3 +37,21 @@ class TestDocumentPage(common.TransactionCase):
})
page.content = 'New content'
self.assertIsNotNone(page.history_ids[0].diff)
def test_page_link(self):
page = self.page_obj.create({
'name': 'Test Page 3',
'content': 'Test content'
})
self.assertEqual(
page.backend_url,
'/web#id={}&model=document.page&view_type=form'.format(page.id)
)
menu = self.env.ref('knowledge.menu_document')
page.menu_id = menu
self.assertEqual(
page.backend_url,
'/web#id={}&model=document.page&view_type=form&action={}'.format(
page.id, menu.action.id
)
)