[Erp5-report] r11132 - /erp5/trunk/products/ERP5Banking/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Nov 6 17:28:47 CET 2006


Author: seb
Date: Mon Nov  6 17:28:46 2006
New Revision: 11132

URL: http://svn.erp5.org?rev=11132&view=rev
Log:
make sure that the script wich calculate the exchange value is working

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

Modified: erp5/trunk/products/ERP5Banking/tests/testERP5BankingCashToCurrencyPurchase.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Banking/tests/testERP5BankingCashToCurrencyPurchase.py?rev=11132&r1=11131&r2=11132&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/tests/testERP5BankingCashToCurrencyPurchase.py (original)
+++ erp5/trunk/products/ERP5Banking/tests/testERP5BankingCashToCurrencyPurchase.py Mon Nov  6 17:28:46 2006
@@ -223,7 +223,7 @@
     Create a cash sorting document and check it
     """
     # Cash sorting has encaisse_paris for source, guichet_1 for destination, and a price cooreponding to the sum of banknote of 10000 and banknotes of 200 ( (2+3) * 10000 + (2+3) * 200 )
-    self.cash_to_currency_purchase = self.cash_to_currency_purchase_module.newContent(id='cash_to_currency_purchase_1', portal_type='Cash To Currency Purchase', source_value=self.guichet, destination_value=None, resource_value = self.currency_2, source_total_asset_price=100.0, discount = 1000.0, quantity = 62000)
+    self.cash_to_currency_purchase = self.cash_to_currency_purchase_module.newContent(id='cash_to_currency_purchase_1', portal_type='Cash To Currency Purchase', source_value=self.guichet, destination_value=None, resource_value = self.currency_2, source_total_asset_price=100.0)
     # execute tic
     self.stepTic()
     # check we have only one cash sorting
@@ -237,6 +237,14 @@
     # check that its destination is guichet_1
     self.assertEqual(self.cash_to_currency_purchase.getDestination(), None)
     self.setDocumentSourceReference(self.cash_to_currency_purchase)
+    # Check carrefully the script CurrencyPurchase_getQuantity
+    script = self.cash_to_currency_purchase.CurrencyPurchase_getQuantity
+    self.assertEqual(script(),65000)
+    self.cash_to_currency_purchase.setDiscountRatio(0.01)
+    self.assertEqual(script(),64350)
+    self.cash_to_currency_purchase.setDiscountRatio(None)
+    self.cash_to_currency_purchase.setDiscount(3000)
+    self.assertEqual(script(),62000)
 
 
   #def stepCreateValidIncomingLine(self, sequence=None, sequence_list=None, **kwd):




More information about the Erp5-report mailing list