Commit 1f6ce553 authored by Aurel's avatar Aurel

do not failed at uninstall if cannot resolve path, add test for this, remove trailling spaces

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12640 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 480946d9
......@@ -827,7 +827,11 @@ class PathTemplateItem(ObjectTemplateItem):
object_keys.reverse()
p = context.getPortalObject()
for path in object_keys:
try:
path_list = self._resolvePath(p, [], path.split('/'))
except AttributeError:
# path seems to not exist anymore
continue
path_list.sort()
path_list.reverse()
for relative_url in path_list:
......
......@@ -2515,6 +2515,53 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet)
def test_101_BusinessTemplateUninstallWithPathAndJoker1Removed(self, quiet=quiet, run=1): #run_all_test):
if not run: return
if not quiet:
message = 'Test Business Template Uninstall With Path And Joker * Removed'
ZopeTestCase._print('\n%s ' % message)
LOG('Testing... ', 0, message)
sequence_list = SequenceList()
# path with subobjects
sequence_string = '\
CreateBaseCategory \
CreateCategories \
CreateNewBusinessTemplate \
UseExportBusinessTemplate \
CheckModifiedBuildingState \
CheckNotInstalledInstallationState \
AddCategoriesAsPathToBusinessTemplate \
BuildBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
CheckObjectPropertiesInBusinessTemplate \
SaveBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
RemoveCategories \
RemoveBusinessTemplate \
RemoveAllTrashBins \
ImportBusinessTemplate \
UseImportBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
InstallBusinessTemplate \
Tic \
CheckInstalledInstallationState \
CheckBuiltBuildingState \
CheckNoTrashBin \
CheckSkinsLayers \
CheckCategoriesExists \
RemoveCategories \
UninstallBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
CheckCategoriesRemoved \
RemoveBaseCategory \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet)
def test_11_BusinessTemplateWithPathAndJoker2(self, quiet=quiet, run=run_all_test):
if not run: return
if not quiet:
......
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