[Erp5-report] r45133 luke - /erp5/trunk/products/ERP5/tests/testBusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Apr 6 16:19:44 CEST 2011


Author: luke
Date: Wed Apr  6 16:19:44 2011
New Revision: 45133

URL: http://svn.erp5.org?rev=45133&view=rev
Log:
 - check that if Document and PropertySheet share same name document is not removed when property sheet is removed

Modified:
    erp5/trunk/products/ERP5/tests/testBusinessTemplate.py

Modified: erp5/trunk/products/ERP5/tests/testBusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testBusinessTemplate.py?rev=45133&r1=45132&r2=45133&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testBusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testBusinessTemplate.py [utf8] Wed Apr  6 16:19:44 2011
@@ -7392,6 +7392,11 @@ class TestBusinessTemplate(ERP5TypeTestC
   def stepCheckDocumentRemoved(self, sequence=None, **kw):
     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):
     sequence_list = SequenceList()
     sequence_string = '\
@@ -7430,6 +7435,77 @@ class TestBusinessTemplate(ERP5TypeTestC
     sequence_list.addSequenceString(sequence_string)
     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():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(TestBusinessTemplate))



More information about the Erp5-report mailing list