Commit 848a25e1 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

try testTemplateNotIndexable with both delivery document and non-delivery...

try testTemplateNotIndexable with both delivery document and non-delivery document. the latter will fail for now.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29286 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5b729732
......@@ -46,7 +46,7 @@ class TestTemplate(ERP5TypeTestCase):
def getBusinessTemplateList(self):
"""Returns list of BT to be installed."""
return ('erp5_base', 'erp5_ui_test')
return ('erp5_base', 'erp5_knowledge_pad', 'erp5_ui_test')
def login(self, name=None):
"""login with Member & Author roles."""
......@@ -63,7 +63,7 @@ class TestTemplate(ERP5TypeTestCase):
portal_preferences.deleteContent(list(portal_preferences.objectIds()))
transaction.commit()
self.tic()
self.portal.portal_types['Preference'].allowed_content_types = ('Foo',)
self.portal.portal_types['Preference'].allowed_content_types = ('Foo', 'Knowledge Pad')
self.portal.foo_module.manage_role(role_to_manage='Author',
permissions=[Permissions.AddPortalContent,
Permissions.CopyOrMove,
......@@ -287,8 +287,11 @@ class TestTemplate(ERP5TypeTestCase):
self.assertEqual(len(preference.objectIds()), 2)
def test_TemplateNotIndexable(self):
def _testTemplateNotIndexable(self, document):
# template documents are not indexable
self.portal.portal_activities.manage_enableActivityTracking()
self.portal.portal_activities.manage_enableActivityTimingLogging()
self.portal.portal_activities.manage_enableActivityCreationTrace()
self.login(self.id())
preference = self.portal.portal_preferences.newContent(portal_type='Preference')
preference.priority = Priority.USER
......@@ -297,13 +300,6 @@ class TestTemplate(ERP5TypeTestCase):
transaction.commit()
self.tic()
document = self.portal.foo_module.newContent(portal_type='Foo')
document.edit(title='My Foo 1')
document.newContent(portal_type='Foo Line')
transaction.commit()
self.tic()
document.Base_makeTemplateFromDocument(form_id=None)
transaction.commit()
self.tic()
......@@ -331,6 +327,22 @@ class TestTemplate(ERP5TypeTestCase):
for template in preference.objectValues():
self.assertFalse(template.isIndexable)
def test_DeliveryTemplateNotIndexable(self):
document = self.portal.foo_module.newContent(portal_type='Foo')
document.edit(title='My Foo 1')
document.newContent(portal_type='Foo Line')
transaction.commit()
self.tic()
self._testTemplateNotIndexable(document)
def test_NonDeliveryTemplateNotIndexable(self):
document = self.portal.knowledge_pad_module.newContent(portal_type='Knowledge Pad')
document.edit(title='My Knowledge Pad 1')
document.newContent(portal_type='Knowledge Box')
transaction.commit()
self.tic()
self._testTemplateNotIndexable(document)
def test_suite():
suite = unittest.TestSuite()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment