Commit 1074beca authored by Yusuke Muraoka's avatar Yusuke Muraoka

add test for well-known bug


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32248 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c8b60ca5
...@@ -196,6 +196,39 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -196,6 +196,39 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
bt = sequence.get('copy_bt') bt = sequence.get('copy_bt')
sequence.edit(current_bt=bt, export_bt=bt) sequence.edit(current_bt=bt, export_bt=bt)
def stepBuildCopyCoreBusinessTemplate(self, sequence=None,
sequence_list=None, **kw):
"""
Build copied core bt
"""
bt = sequence.get('copy_bt')
self.assertEquals(bt.getTitle(), 'erp5_core')
bt.build()
def stepInstallCopyCoreBusinessTemplate(self, sequence=None,
sequence_list=None, **kw):
"""
Install copied core bt
"""
bt = sequence.get('copy_bt')
self.assertEquals(bt.getTitle(), 'erp5_core')
self.assertEquals(bt.getInstallationState(), 'not_installed')
bt.install()
def stepCheckOriginalAndCopyBusinessTemplate(self, sequence=None,
sequence_list=None, **kw):
original_bt = sequence.get('current_bt')
copy_bt = sequence.get('copy_bt')
self.assertEquals(original_bt.getBuildingState(), 'built')
self.assertEquals(copy_bt.getBuildingState(), 'built')
for item_name in original_bt._item_name_list:
original_obj = getattr(original_bt, item_name)
copy_obj = getattr(copy_bt, item_name)
self.failIf(original_obj is None)
self.failIf(copy_obj is None)
self.assertEquals(original_obj.getKeys(), copy_obj.getKeys())
def stepUseExportBusinessTemplate(self, sequence=None, def stepUseExportBusinessTemplate(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
""" """
...@@ -5778,6 +5811,39 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -5778,6 +5811,39 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
def test_164_checkCopyBuild(self, quiet=quiet, run=run_all_test):
if not run: return
if not quiet:
message = 'Test Check basic copy and build is working'
ZopeTestCase._print('\n%s ' % message)
LOG('Testing... ', 0, message)
sequence_list = SequenceList()
sequence_string = '\
UseCoreBusinessTemplate \
CopyCoreBusinessTemplate \
BuildCopyCoreBusinessTemplate \
CheckOriginalAndCopyBusinessTemplate \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet)
def test_165_checkCopyBuildInstall(self, quiet=quiet, run=run_all_test):
if not run: return
if not quiet:
message = 'Test Check basic copy, build and installation is working'
ZopeTestCase._print('\n%s ' % message)
LOG('Testing... ', 0, message)
sequence_list = SequenceList()
sequence_string = '\
UseCoreBusinessTemplate \
CopyCoreBusinessTemplate \
BuildCopyCoreBusinessTemplate \
InstallCopyCoreBusinessTemplate \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet)
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