Commit ca5b9805 authored by Łukasz Nowak's avatar Łukasz Nowak

- check that if Document and PropertySheet share same name document is not...

 - check that if Document and PropertySheet share same name document is not removed when property sheet is removed


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45133 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 57fc22a1
...@@ -7392,6 +7392,11 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -7392,6 +7392,11 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
def stepCheckDocumentRemoved(self, sequence=None, **kw): def stepCheckDocumentRemoved(self, sequence=None, **kw):
self.failIf(os.path.exists(sequence['document_path'])) self.failIf(os.path.exists(sequence['document_path']))
def stepCheckDocumentPropertySheetSameName(self, sequence=None, **kw):
self.assertEqual(sequence['ps_title'], sequence['document_title'])
self.assertEqual(os.path.basename(sequence['document_path']),
os.path.basename(sequence['ps_path']))
def test_BusinessTemplateWithDocument(self): def test_BusinessTemplateWithDocument(self):
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = '\ sequence_string = '\
...@@ -7430,6 +7435,77 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -7430,6 +7435,77 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def stepRemovePropertySheetFromBusinessTemplate(self, sequence=None, **kw):
"""
Add Property Sheet to Business Template
"""
sequence['current_bt'].edit(template_property_sheet_id_list=[sequence['ps_title']])
def test_BusinessTemplateWithDocumentPropertySheetRemoved(self):
"""Checks that if Business Template defines Document and PropertySheet
Document is not removed"""
sequence_list = SequenceList()
sequence_string = '\
CreateDocument \
CreatePropertySheet \
CheckDocumentPropertySheetSameName \
CreateNewBusinessTemplate \
UseExportBusinessTemplate \
AddDocumentToBusinessTemplate \
AddPropertySheetToBusinessTemplate \
CheckModifiedBuildingState \
CheckNotInstalledInstallationState \
BuildBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
CheckObjectPropertiesInBusinessTemplate \
SaveBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
RemoveDocument \
RemovePropertySheet \
RemoveBusinessTemplate \
RemoveAllTrashBins \
ImportBusinessTemplate \
UseImportBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
InstallBusinessTemplate \
Tic \
CheckInstalledInstallationState \
CheckBuiltBuildingState \
CheckNoTrashBin \
CheckDocumentExists \
CheckPropertySheetExists \
\
CopyBusinessTemplate \
Tic \
\
RemovePropertySheetFromBusinessTemplate \
CheckModifiedBuildingState \
CheckNotInstalledInstallationState \
BuildBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
CheckObjectPropertiesInBusinessTemplate \
SaveBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
ImportBusinessTemplate \
UseImportBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
InstallBusinessTemplate \
Tic \
\
CheckInstalledInstallationState \
CheckBuiltBuildingState \
CheckPropertySheetRemoved \
CheckDocumentExists \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestBusinessTemplate)) suite.addTest(unittest.makeSuite(TestBusinessTemplate))
......
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