Commit 50a33c53 authored by Christophe Dumez's avatar Christophe Dumez

- Added a unit test for revision incrementing


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8319 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 67c2924f
......@@ -1532,6 +1532,24 @@ class TestBusinessTemplate(ERP5TypeTestCase):
self.failUnless(base_category_obj is not None)
self.assertEquals(len(base_category_obj.objectIds()), 0)
def stepCheckInitialRevision(self, sequence=None, sequence_list=None, **kw):
""" Check if revision of a new bt is an empty string
"""
bt = sequence.get('export_bt')
self.assertEqual(bt.getRevision(), '')
def stepCheckFirstRevision(self, sequence=None, sequence_list=None, **kw):
""" Check if revision of the bt is 1
"""
bt = sequence.get('export_bt')
self.assertEqual(bt.getRevision(), '1')
def stepCheckSecondRevision(self, sequence=None, sequence_list=None, **kw):
""" Check if revision of the bt is 2
"""
bt = sequence.get('export_bt')
self.assertEqual(bt.getRevision(), '2')
# tests
def test_01_checkNewSite(self, quiet=0, run=run_all_test):
if not run: return
......@@ -2701,6 +2719,29 @@ class TestBusinessTemplate(ERP5TypeTestCase):
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
# test of portal types
def test_22_RevisionNumberIsIncremented(self, quiet=0, run=run_all_test):
if not run: return
if not quiet:
message = 'Test Business Template With Portal Types'
ZopeTestCase._print('\n%s ' % message)
LOG('Testing... ', 0, message)
sequence_list = SequenceList()
sequence_string = '\
CreatePortalType \
CreateNewBusinessTemplate \
UseExportBusinessTemplate \
CheckInitialRevision \
BuildBusinessTemplate \
CheckBuiltBuildingState \
stepCheckFirstRevision \
BuildBusinessTemplate \
stepCheckSecondRevision \
RemoveBusinessTemplate \
RemovePortalType \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
if __name__ == '__main__':
framework()
......
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