[Erp5-report] r45297 luke - /erp5/trunk/products/ERP5/tests/testBusinessTemplate.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 11 17:49:07 CEST 2011
Author: luke
Date: Mon Apr 11 17:49:06 2011
New Revision: 45297
URL: http://svn.erp5.org?rev=45297&view=rev
Log:
- remove Constraint testing, as it is done in own mixin and no code is required to test them
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=45297&r1=45296&r2=45297&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testBusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testBusinessTemplate.py [utf8] Mon Apr 11 17:49:06 2011
@@ -2420,92 +2420,6 @@ class BusinessTemplateMixin(ERP5TypeTest
# Property Sheet will be installed in ZODB
self.failUnless(getattr(self.portal.portal_property_sheets, ps_title, None) is not None)
- # Test Constraint
- def stepCreateConstraint(self, sequence=None, **kw):
- """
- Create a Constraint
- """
- ct_title = 'UnitTest'
- ct_data = ' \nclass UnitTest: \n """ \n Fake constraint for unit test \n \
- """ \n _properties = ( \n ) \n _categories = ( \n ) \n\n'
- cfg = getConfiguration()
- file_path = os.path.join(cfg.instancehome, 'Constraint', ct_title+'.py')
- if os.path.exists(file_path):
- os.remove(file_path)
- f = file(file_path, 'w')
- f.write(ct_data)
- f.close()
- self.failUnless(os.path.exists(file_path))
- sequence.edit(ct_title=ct_title, ct_path=file_path, ct_data=ct_data)
-
- def stepAddConstraintToBusinessTemplate(self, sequence=None, **kw):
- """
- Add Constraint to Business Template
- """
- bt = sequence.get('current_bt', None)
- self.failUnless(bt is not None)
- ct_title = sequence.get('ct_title', None)
- self.failUnless(ct_title is not None)
- bt.edit(template_constraint_id_list=[ct_title])
-
- def stepRemoveConstraint(self, sequence=None, sequencer_list=None, **kw):
- """
- Remove Constraint
- """
- ct_path = sequence.get('ct_path', None)
- self.failUnless(ct_path is not None)
- self.failUnless(os.path.exists(ct_path))
- os.remove(ct_path)
- self.failIf(os.path.exists(ct_path))
-
- def stepCheckConstraintExists(self, sequence=None, sequencer_list=None, **kw):
- """
- Check presence of Constraint
- """
- ct_path = sequence.get('ct_path', None)
- ct_data = sequence.get('ct_data', None)
- self.failUnless(ct_path is not None)
- self.failUnless(os.path.exists(ct_path))
- # check data in property sheet
- f = file(ct_path, 'r')
- data = f.read()
- self.assertEqual(data, ct_data)
-
- def stepCheckConstraintRemoved(self, sequence=None, sequencer_list=None, **kw):
- ct_path = sequence.get('ct_path', None)
- self.failUnless(ct_path is not None)
- self.failIf(os.path.exists(ct_path))
-
- def stepCreateUpdatedConstraint(self, sequence=None, **kw):
- """
- Create a Constraint
- """
- ct_title = 'UnitTest'
- ct_data = ' \nclass UnitTest2: \n """ \n Second Fake constraint for unit test \n \
- """ \n _properties = ( \n ) \n _categories = ( \n ) \n\n'
- cfg = getConfiguration()
- file_path = os.path.join(cfg.instancehome, 'Constraint', ct_title+'.py')
- if os.path.exists(file_path):
- os.remove(file_path)
- f = file(file_path, 'w')
- f.write(ct_data)
- f.close()
- self.failUnless(os.path.exists(file_path))
- sequence.edit(ct_data_u=ct_data)
-
- def stepCheckUpdatedConstraintExists(self, sequence=None, sequencer_list=None, **kw):
- """
- Check presence of Constraint
- """
- ct_path = sequence.get('ct_path', None)
- ct_data = sequence.get('ct_data_u', None)
- self.failUnless(ct_path is not None)
- self.failUnless(os.path.exists(ct_path))
- # check data in property sheet
- f = file(ct_path, 'r')
- data = f.read()
- self.assertEqual(data, ct_data)
-
# Busines templates
def stepImportBusinessTemplate(self, sequence=None, **kw):
"""
@@ -4679,109 +4593,6 @@ class TestBusinessTemplate(BusinessTempl
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
- def test_156_BusinessTemplateWithConstraint(self):
- """Test Business Template With Constraint"""
- sequence_list = SequenceList()
- sequence_string = '\
- CreateConstraint \
- CreateNewBusinessTemplate \
- UseExportBusinessTemplate \
- AddConstraintToBusinessTemplate \
- CheckModifiedBuildingState \
- CheckNotInstalledInstallationState \
- BuildBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- CheckObjectPropertiesInBusinessTemplate \
- SaveBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- RemoveConstraint \
- RemoveBusinessTemplate \
- RemoveAllTrashBins \
- ImportBusinessTemplate \
- UseImportBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- InstallBusinessTemplate \
- Tic \
- CheckInstalledInstallationState \
- CheckBuiltBuildingState \
- CheckNoTrashBin \
- CheckSkinsLayers \
- CheckConstraintExists \
- UninstallBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- CheckConstraintRemoved \
- '
- sequence_list.addSequenceString(sequence_string)
- sequence_list.play(self)
-
- def test_157_BusinessTemplateUpdateWithConstraint(self):
- """Test Business Template With Constraint"""
- sequence_list = SequenceList()
- sequence_string = '\
- CreateConstraint \
- CreateNewBusinessTemplate \
- UseExportBusinessTemplate \
- AddConstraintToBusinessTemplate \
- CheckModifiedBuildingState \
- CheckNotInstalledInstallationState \
- BuildBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- CheckObjectPropertiesInBusinessTemplate \
- SaveBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- RemoveConstraint \
- RemoveBusinessTemplate \
- RemoveAllTrashBins \
- ImportBusinessTemplate \
- UseImportBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- InstallBusinessTemplate \
- Tic \
- CheckInstalledInstallationState \
- CheckBuiltBuildingState \
- CheckNoTrashBin \
- CheckSkinsLayers \
- CheckConstraintExists \
- RemoveConstraint \
- CreateUpdatedConstraint \
- CreateNewBusinessTemplate \
- UseExportBusinessTemplate \
- AddConstraintToBusinessTemplate \
- CheckModifiedBuildingState \
- CheckNotInstalledInstallationState \
- BuildBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- CheckObjectPropertiesInBusinessTemplate \
- SaveBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- CreateConstraint \
- RemoveBusinessTemplate \
- RemoveAllTrashBins \
- ImportBusinessTemplate \
- UseImportBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- InstallBusinessTemplate \
- Tic \
- CheckUpdatedConstraintExists \
- UninstallBusinessTemplate \
- CheckBuiltBuildingState \
- CheckNotInstalledInstallationState \
- CheckConstraintRemoved \
- CheckWorkflowChainRemoved \
- '
- sequence_list.addSequenceString(sequence_string)
- sequence_list.play(self)
-
def test_16_BusinessTemplateWithAllItems(self):
"""Test Business Template With All Items"""
sequence_list = SequenceList()
More information about the Erp5-report
mailing list