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