Commit 2aa34f24 authored by Aurel's avatar Aurel

add a way to define a currency without exchange line

fix variable name for price currency definition


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24726 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5697f4f4
...@@ -311,13 +311,16 @@ class TestERP5BankingMixin: ...@@ -311,13 +311,16 @@ class TestERP5BankingMixin:
self.tic() self.tic()
def createCurrency(self, currency_list=(('EUR', 'Euro', 1/650., 'USD'), ('USD', 'Dollar', 650., 'EUR'))): def createCurrency(self, currency_list=(('EUR', 'Euro', 1/650., 'USD'), ('USD', 'Dollar', 650., 'EUR')), only_currency=False):
# create the currency document for euro inside the currency module # create the currency document for euro inside the currency module
#currency_list = (('EUR', 'Euro', 1/650., 'USD'), ('USD', 'Dollar', 650., 'EUR')) #currency_list = (('EUR', 'Euro', 1/650., 'USD'), ('USD', 'Dollar', 650., 'EUR'))
# first create currency # first create currency
for currency_id, title, base_price, price_currency in currency_list: for currency_id, title, base_price, price_currency in currency_list:
currency = self.getCurrencyModule().newContent(id=currency_id, title=title, reference=currency_id) currency = self.getCurrencyModule().newContent(id=currency_id, title=title, reference=currency_id)
if only_currency:
return
# second, create exchange lines # second, create exchange lines
for currency_id, title, base_price, price_currency in currency_list: for currency_id, title, base_price, price_currency in currency_list:
currency = self.getCurrencyModule()[currency_id] currency = self.getCurrencyModule()[currency_id]
...@@ -329,7 +332,7 @@ class TestERP5BankingMixin: ...@@ -329,7 +332,7 @@ class TestERP5BankingMixin:
'currency_exchange_type/purchase', 'currency_exchange_type/purchase',
'currency_exchange_type/transfer'], 'currency_exchange_type/transfer'],
) )
exchange_line.setPriceCurrencyValue(self.getCurrencyModule()[currency_id]) exchange_line.setPriceCurrencyValue(self.getCurrencyModule()[price_currency])
cell_list = exchange_line.objectValues() cell_list = exchange_line.objectValues()
self.assertEquals(len(cell_list),3) self.assertEquals(len(cell_list),3)
for cell in cell_list: for cell in cell_list:
......
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