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,6 +669,11 @@ class TestERP5BankingMixin: ...@@ -669,6 +669,11 @@ class TestERP5BankingMixin:
date_object = container.newContent(id=id, portal_type=portal_type, date_object = container.newContent(id=id, portal_type=portal_type,
site_value = site, start_date = date) site_value = site, start_date = date)
if open: if 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() date_object.open()
setattr(self, id, date_object) setattr(self, id, date_object)
date_object.assignRoleToSecurityGroup() date_object.assignRoleToSecurityGroup()
......
...@@ -148,7 +148,7 @@ class TestERP5BankingAvailableInventory(TestERP5BankingCheckPaymentMixin, ...@@ -148,7 +148,7 @@ class TestERP5BankingAvailableInventory(TestERP5BankingCheckPaymentMixin,
Make sure we can not open the counter date twice Make sure we can not open the counter date twice
""" """
self.openCounterDate(site=self.paris,id='counter_date_7',open=0) 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 # open counter date and counter
self.assertRaises(ValidationFailed, self.assertRaises(ValidationFailed,
self.workflow_tool.doActionFor, self.workflow_tool.doActionFor,
...@@ -256,6 +256,7 @@ class TestERP5BankingAvailableInventory(TestERP5BankingCheckPaymentMixin, ...@@ -256,6 +256,7 @@ class TestERP5BankingAvailableInventory(TestERP5BankingCheckPaymentMixin,
counter_date = self.counter_date_1 counter_date = self.counter_date_1
counter_date.setStartDate(self.date-10) counter_date.setStartDate(self.date-10)
self.assertEquals(counter_date.getReference(),'1') self.assertEquals(counter_date.getReference(),'1')
counter_date.close()
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
self.openCounterDate(site=self.paris, id='counter_date_3') self.openCounterDate(site=self.paris, id='counter_date_3')
...@@ -357,6 +358,7 @@ class TestERP5BankingAvailableInventory(TestERP5BankingCheckPaymentMixin, ...@@ -357,6 +358,7 @@ class TestERP5BankingAvailableInventory(TestERP5BankingCheckPaymentMixin,
'ResetInventoryInVaultForeignCurrency Tic ' \ 'ResetInventoryInVaultForeignCurrency Tic ' \
'CheckRightStockBeforeClosingDate ' \ 'CheckRightStockBeforeClosingDate ' \
'CheckReferenceIsIncreasedEveryDay ' \ 'CheckReferenceIsIncreasedEveryDay ' \
'Tic ' \
'CheckOpenCounterDateTwiceWithOtherDateFail Tic ' 'CheckOpenCounterDateTwiceWithOtherDateFail Tic '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
# play the sequence # 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