Commit cc26793c authored by Arnaud Fontaine's avatar Arnaud Fontaine Committed by Łukasz Nowak

Validate Components upon bt5 installation.

(cherry picked from commit 583d5b149312d7c4cd45e58bc1793fc02722f559)
parent 93731edc
......@@ -4022,6 +4022,11 @@ class DocumentTemplateItem(FilesystemToZodbTemplateItem):
if self._is_already_migrated(object_list):
ObjectTemplateItem.install(self, context, **kw)
portal = context.getPortalObject()
for object_path in object_list:
obj = portal.unrestrictedTraverse(object_path)
obj.validate()
self.portal_components.reset(force=True, reset_portal_type=True)
else:
FilesystemDocumentTemplateItem.install(self, context, **kw)
......
......@@ -7003,10 +7003,14 @@ class TestDocumentTemplateItem(BusinessTemplateMixin):
self.getPortalObject().portal_components.deleteContent(
sequence['document_id'])
def stepCheckZodbDocumentExists(self, sequence=None, **kw):
def stepCheckZodbDocumentExistsAndValidated(self, sequence=None, **kw):
self.assertHasAttribute(self.getPortalObject().portal_components,
sequence['document_id'])
self.assertEquals(getattr(self.getPortalObject().portal_components,
sequence['document_id']).getValidationState(),
'validated')
def stepCheckZodbDocumentRemoved(self, sequence=None, **kw):
component_tool = self.getPortalObject().portal_components
self.failIf(sequence['document_id'] in component_tool.objectIds())
......@@ -7074,7 +7078,7 @@ class TestDocumentTemplateItem(BusinessTemplateMixin):
CheckBuiltBuildingState \
CheckNoTrashBin \
CheckSkinsLayers \
CheckZodbDocumentExists \
CheckZodbDocumentExistsAndValidated \
UninstallBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
......@@ -7139,7 +7143,7 @@ class TestDocumentTemplateItem(BusinessTemplateMixin):
CheckBuiltBuildingState \
CheckNoTrashBin \
CheckSkinsLayers \
CheckZodbDocumentExists \
CheckZodbDocumentExistsAndValidated \
UninstallBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
......@@ -7254,7 +7258,7 @@ class TestDocumentTemplateItem(BusinessTemplateMixin):
InstallWithoutForceBusinessTemplate \
Tic \
\
CheckZodbDocumentExists \
CheckZodbDocumentExistsAndValidated \
CheckInstalledInstallationState \
CheckBuiltBuildingState \
\
......
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