[Erp5-report] r8808 - /erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jul 26 16:15:10 CEST 2006


Author: seb
Date: Wed Jul 26 16:15:07 2006
New Revision: 8808

URL: http://svn.erp5.org?rev=8808&view=rev
Log:
added currency exchange lines

Modified:
    erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py

Modified: erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py?rev=8808&r1=8807&r2=8808&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py (original)
+++ erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py Wed Jul 26 16:15:07 2006
@@ -241,6 +241,12 @@
     """
     return getattr(self.getPortal(), 'checkbook_usual_cash_transfer_module', None)
 
+  def getCheckbookMovementModule(self):
+    """
+    Return the Checkbook Movement Module
+    """
+    return getattr(self.getPortal(), 'checkbook_movement_module', None)
+
   def getCheckModule(self):
     """
     Return the Check Module
@@ -273,7 +279,21 @@
 
   def createCurrency(self, id='EUR', title='Euro'):
     # create the currency document for euro inside the currency module
-    return self.currency_module.newContent(id=id, title=title)
+    currency = self.currency_module.newContent(id=id, title=title)
+    if id!='EUR':
+      # Create an exchange line
+      exchange_line = currency.newContent(portal_type='Currency Exchange Line',
+          start_date='01/01/1900',stop_date='01/01/2900',
+          price_currency='currency_module/EUR',
+          currency_exchange_type_list=['currency_exchange_type/sale',
+                                       'currency_exchange_type/purchase'],
+          base_price=2)
+      cell_list = exchange_line.objectValues()
+      self.assertEquals(len(cell_list),2)
+      for cell in cell_list:
+        cell.setBasePrice(2.1)
+        cell.setDiscount(0.1)
+    return currency
 
 
   def createBanknotesAndCoins(self):
@@ -407,6 +427,11 @@
     # add category unit in quantity_unit which is the unit that will be used for banknotes and coins
     self.variation_base_category = getattr(self.category_tool, 'quantity_unit')
     self.unit = self.variation_base_category.newContent(id='unit', title='Unit')
+
+    # add category for currency_exchange_type
+    self.currency_exchange_type = getattr(self.category_tool,'currency_exchange_type')
+    self.currency_exchange_type.newContent(id='sale')
+    self.currency_exchange_type.newContent(id='purchase')
 
     # get the base category function
     self.function_base_category = getattr(self.category_tool, 'function')




More information about the Erp5-report mailing list