Commit 52528ea0 authored by Sebastien Robin's avatar Sebastien Robin

added stop payment unit test

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10731 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c8a69023
...@@ -205,6 +205,12 @@ class TestERP5BankingMixin: ...@@ -205,6 +205,12 @@ class TestERP5BankingMixin:
""" """
return getattr(self.getPortal(), 'check_payment_module', None) return getattr(self.getPortal(), 'check_payment_module', None)
def getStopPaymentModule(self):
"""
Return the Stop Payment Module
"""
return getattr(self.getPortal(), 'stop_payment_module', None)
def getCheckDepositModule(self): def getCheckDepositModule(self):
""" """
Return the Check Deposit Module Return the Check Deposit Module
...@@ -285,8 +291,8 @@ class TestERP5BankingMixin: ...@@ -285,8 +291,8 @@ class TestERP5BankingMixin:
def createCurrency(self, id='EUR', title='Euro'): def createCurrency(self, id='EUR', title='Euro'):
# create the currency document for euro inside the currency module # create the currency document for euro inside the currency module
currency = self.currency_module.newContent(id=id, title=title) currency = self.getCurrencyModule().newContent(id=id, title=title)
if id!='EUR': if id=='USD':
# Create an exchange line # Create an exchange line
exchange_line = currency.newContent(portal_type='Currency Exchange Line', exchange_line = currency.newContent(portal_type='Currency Exchange Line',
start_date='01/01/1900',stop_date='01/01/2900', start_date='01/01/1900',stop_date='01/01/2900',
...@@ -454,6 +460,7 @@ class TestERP5BankingMixin: ...@@ -454,6 +460,7 @@ class TestERP5BankingMixin:
self.controleur_caisse_courante = self.banking.newContent(id='controleur_caisse_courante', portal_type='Category', codification='CCC') self.controleur_caisse_courante = self.banking.newContent(id='controleur_caisse_courante', portal_type='Category', codification='CCC')
self.controleur_caveau = self.banking.newContent(id='controleur_caveau', portal_type='Category', codification='CCA') self.controleur_caveau = self.banking.newContent(id='controleur_caveau', portal_type='Category', codification='CCA')
self.comptable = self.banking.newContent(id='comptable', portal_type='Category', codification='FXF') self.comptable = self.banking.newContent(id='comptable', portal_type='Category', codification='FXF')
self.commis_comptable = self.banking.newContent(id='commis_comptable', portal_type='Category', codification='CBM')
self.chef_section_comptable = self.banking.newContent(id='chef_section_comptable', portal_type='Category', codification='CSB') self.chef_section_comptable = self.banking.newContent(id='chef_section_comptable', portal_type='Category', codification='CSB')
self.chef_comptable = self.banking.newContent(id='chef_comptable', portal_type='Category', codification='CCB') self.chef_comptable = self.banking.newContent(id='chef_comptable', portal_type='Category', codification='CCB')
self.chef_de_tri = self.banking.newContent(id='chef_de_tri', portal_type='Category', codification='CTR') self.chef_de_tri = self.banking.newContent(id='chef_de_tri', portal_type='Category', codification='CTR')
......
...@@ -48,48 +48,26 @@ os.environ['EVENT_LOG_SEVERITY'] = '-300' ...@@ -48,48 +48,26 @@ os.environ['EVENT_LOG_SEVERITY'] = '-300'
if __name__ == '__main__': if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py')) execfile(os.path.join(sys.path[0], 'framework.py'))
class TestERP5BankingCheckbookDeliveryMixin:
def createCheckbookDelivery(self, sequence=None, sequence_list=None, **kwd):
class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookUsualCashTransferMixin,
TestERP5BankingMixin, ERP5TypeTestCase):
"""
This class is a unit test to check the module of Cash Transfer
Here are the following step that will be done in the test :
XXX to be completed
"""
login = PortalTestCase.login
# pseudo constants
RUN_ALL_TEST = 1 # we want to run all test
QUIET = 0 # we don't want the test to be quiet
def getTitle(self):
"""
Return the title of the test
"""
return "ERP5BankingCheckbookDelivery"
def getBusinessTemplateList(self):
""" """
Return the list of business templates we need to run the test. Create a checkbook delivery
This method is called during the initialization of the unit test by
the unit test framework in order to know which business templates
need to be installed to run the test on.
""" """
return ('erp5_base', # We will do the transfer ot two items.
'erp5_trade', self.checkbook_delivery = self.checkbook_delivery_module.newContent(
'erp5_accounting', id='checkbook_delivery', portal_type='Checkbook Delivery',
'erp5_banking_core', source_value=self.source_site, destination_value=None,
'erp5_banking_inventory', resource_value=self.currency_1,
'erp5_banking_check', start_date=self.date)
) self.line_2 = self.checkbook_delivery.newContent(quantity=1,
resource_value=self.check_model_1,
check_amount_value=None,
destination_trade_value=self.bank_account_2,
aggregate_value=self.check_1,
)
self.workflow_tool.doActionFor(self.checkbook_delivery, 'deliver_action',
wf_id='checkbook_delivery_workflow')
def afterSetUp(self): def afterSetUp(self):
""" """
...@@ -153,6 +131,48 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookUsualCashTransfer ...@@ -153,6 +131,48 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookUsualCashTransfer
self.openCounterDate(site=self.paris) self.openCounterDate(site=self.paris)
class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin,
TestERP5BankingCheckbookUsualCashTransferMixin,
TestERP5BankingMixin, ERP5TypeTestCase):
"""
This class is a unit test to check the module of Cash Transfer
Here are the following step that will be done in the test :
XXX to be completed
"""
login = PortalTestCase.login
# pseudo constants
RUN_ALL_TEST = 1 # we want to run all test
QUIET = 0 # we don't want the test to be quiet
def getTitle(self):
"""
Return the title of the test
"""
return "ERP5BankingCheckbookDelivery"
def getBusinessTemplateList(self):
"""
Return the list of business templates we need to run the test.
This method is called during the initialization of the unit test by
the unit test framework in order to know which business templates
need to be installed to run the test on.
"""
return ('erp5_base',
'erp5_trade',
'erp5_accounting',
'erp5_banking_core',
'erp5_banking_inventory',
'erp5_banking_check',
)
def stepCheckObjects(self, sequence=None, sequence_list=None, **kwd): def stepCheckObjects(self, sequence=None, sequence_list=None, **kwd):
""" """
Check that all the objects we created in afterSetUp or Check that all the objects we created in afterSetUp or
......
This diff is collapsed.
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