Commit c7fb7be0 authored by Jérome Perrin's avatar Jérome Perrin

Check allowed content types are correctly installed (not complete yet,

it has to be extended to update an existing type)



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7082 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca4c5550
......@@ -259,17 +259,23 @@ class TestBusinessTemplate(ERP5TypeTestCase):
"""
pt = self.getTypeTool()
# create module object portal type
pt.manage_addTypeInformation(ERP5TypeInformation.meta_type, id='Geek Object', typeinfo_name='ERP5Type: ERP5 Person')
pt.manage_addTypeInformation(ERP5TypeInformation.meta_type,
id='Geek Object',
typeinfo_name='ERP5Type: ERP5 Person',)
object_type = pt._getOb('Geek Object', None)
self.failUnless(object_type is not None)
sequence.edit(object_ptype_id=object_type.getId())
# create module portal type
pt.manage_addTypeInformation(ERP5TypeInformation.meta_type, id='Geek Module', typeinfo_name='ERP5Type: ERP5 Folder')
pt.manage_addTypeInformation(ERP5TypeInformation.meta_type,
id='Geek Module',
typeinfo_name='ERP5Type: ERP5 Folder')
module_type = pt._getOb('Geek Module', None)
self.failUnless(module_type is not None)
module_type.filter_content_types = 1
module_type.allowed_content_types = ('Geek Object',)
sequence.edit(module_ptype_id=module_type.getId())
sequence.edit(module_ptype_id=module_type.getId(),
module_ptype_filter_content_types=module_type.filter_content_types,
module_ptype_allowed_content_types=module_type.allowed_content_types)
def stepAddPortalTypeToBusinessTemplate(self, sequence=None, sequence_list=None, **kw):
"""
......@@ -306,6 +312,10 @@ class TestBusinessTemplate(ERP5TypeTestCase):
module_id = sequence.get('module_ptype_id')
module_type = pt._getOb(module_id, None)
self.failUnless(module_type is not None)
self.failUnless(module_type.allowed_content_types,
sequence.get('module_ptype_allowed_content_types'))
self.failUnless(module_type.filter_content_types,
sequence.get('module_ptype_filter_content_types'))
object_type = pt._getOb(object_id, None)
self.failUnless(object_type is not None)
......
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