Commit a7c1827e authored by Sebastien Robin's avatar Sebastien Robin

use the workflow action when opening a counter date, also a tic was missing

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19365 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8b7b1744
......@@ -669,7 +669,12 @@ class TestERP5BankingMixin:
date_object = container.newContent(id=id, portal_type=portal_type,
site_value = site, start_date = date)
if open:
date_object.open()
if date_object.getPortalType() == 'Counter Date':
self.workflow_tool.doActionFor(date_object, 'open_action',
wf_id='counter_date_workflow',
your_check_date_is_today=0)
else:
date_object.open()
setattr(self, id, date_object)
date_object.assignRoleToSecurityGroup()
......
......@@ -148,7 +148,7 @@ class TestERP5BankingAvailableInventory(TestERP5BankingCheckPaymentMixin,
Make sure we can not open the counter date twice
"""
self.openCounterDate(site=self.paris,id='counter_date_7',open=0)
self.counter_date_7.setStartDate(DateTime()-1)
self.counter_date_7.setStartDate(DateTime())
# open counter date and counter
self.assertRaises(ValidationFailed,
self.workflow_tool.doActionFor,
......@@ -256,6 +256,7 @@ class TestERP5BankingAvailableInventory(TestERP5BankingCheckPaymentMixin,
counter_date = self.counter_date_1
counter_date.setStartDate(self.date-10)
self.assertEquals(counter_date.getReference(),'1')
counter_date.close()
get_transaction().commit()
self.tic()
self.openCounterDate(site=self.paris, id='counter_date_3')
......@@ -357,6 +358,7 @@ class TestERP5BankingAvailableInventory(TestERP5BankingCheckPaymentMixin,
'ResetInventoryInVaultForeignCurrency Tic ' \
'CheckRightStockBeforeClosingDate ' \
'CheckReferenceIsIncreasedEveryDay ' \
'Tic ' \
'CheckOpenCounterDateTwiceWithOtherDateFail Tic '
sequence_list.addSequenceString(sequence_string)
# play the sequence
......
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