[Erp5-report] r38316 jerome - /erp5/trunk/products/ERP5/tests/testERP5CurrencyExchangeLine.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Sep 13 17:30:06 CEST 2010


Author: jerome
Date: Mon Sep 13 17:29:56 2010
New Revision: 38316

URL: http://svn.erp5.org?rev=38316&view=rev
Log:
normalize the use of portal and self.portal

Modified:
    erp5/trunk/products/ERP5/tests/testERP5CurrencyExchangeLine.py

Modified: erp5/trunk/products/ERP5/tests/testERP5CurrencyExchangeLine.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5CurrencyExchangeLine.py?rev=38316&r1=38315&r2=38316&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5CurrencyExchangeLine.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5CurrencyExchangeLine.py [utf8] Mon Sep 13 17:29:56 2010
@@ -107,10 +107,9 @@ class TestCurrencyExchangeLine(Accountin
       Create a currency exchange line for a currency and then
       convert destination price using that currency exchange line
     """
-    portal = self.getPortal()
     self.organisation_module = self.portal.organisation_module
     self.organisation1 = self.organisation_module.my_organisation
-    new_currency = portal.currency_module.newContent(
+    new_currency = self.portal.currency_module.newContent(
                           portal_type='Currency')
     new_currency.setReference('XOF')
     new_currency.setTitle('Francs CFA')
@@ -147,7 +146,7 @@ class TestCurrencyExchangeLine(Accountin
                            destination_credit=500)))
     invoice.AccountingTransaction_convertDestinationPrice(form_id='view')
     line_list = invoice.contentValues(
-           portal_type=portal.getPortalAccountingMovementTypeList())
+           portal_type=self.portal.getPortalAccountingMovementTypeList())
     for line in line_list:
       self.assertEquals(line.getDestinationTotalAssetPrice(),
              round(655.957*line.getQuantity()))
@@ -159,10 +158,9 @@ class TestCurrencyExchangeLine(Accountin
       and verify that only the one that matches the criteria will
       be selected for the conversion
     """
-    portal = self.getPortal()
     self.organisation_module = self.portal.organisation_module
     self.organisation1 = self.organisation_module.my_organisation
-    new_currency = portal.currency_module.newContent(
+    new_currency = self.portal.currency_module.newContent(
                    portal_type='Currency')
     new_currency.setReference('XOF')
     new_currency.setTitle('Francs CFA')
@@ -215,7 +213,7 @@ class TestCurrencyExchangeLine(Accountin
     invoice.AccountingTransaction_convertDestinationPrice(
                          form_id='view')
     line_list = invoice.contentValues(
-           portal_type=portal.getPortalAccountingMovementTypeList())
+           portal_type=self.portal.getPortalAccountingMovementTypeList())
     for line in line_list:
       self.assertEquals(line.getDestinationTotalAssetPrice(),
                    round(655.957*line.getQuantity()))
@@ -226,10 +224,9 @@ class TestCurrencyExchangeLine(Accountin
       convert
       source price using that currency exchange line
     """
-    portal = self.getPortal()
     self.organisation_module = self.portal.organisation_module
     self.organisation1 = self.organisation_module.my_organisation
-    new_currency = portal.currency_module.newContent(portal_type='Currency')
+    new_currency = self.portal.currency_module.newContent(portal_type='Currency')
     new_currency.setReference('XOF')
     new_currency.setTitle('Francs CFA')
     new_currency.setBaseUnitQuantity(1.00)
@@ -265,7 +262,7 @@ class TestCurrencyExchangeLine(Accountin
     invoice.AccountingTransaction_convertSourcePrice(
                    form_id='view')
     line_list = invoice.contentValues(
-           portal_type=portal.getPortalAccountingMovementTypeList())
+           portal_type=self.portal.getPortalAccountingMovementTypeList())
     for line in line_list:
       if line.getSourceValue() == self.account_module.goods_purchase:
         self.assertEquals(line.getSourceInventoriatedTotalAssetDebit(),
@@ -281,10 +278,9 @@ class TestCurrencyExchangeLine(Accountin
       Test that the conversion is not done when there is no currency 
       exchange line defined for the date of the transaction
     """
-    portal = self.getPortal()
     self.organisation_module = self.portal.organisation_module
     self.organisation1 = self.organisation_module.my_organisation
-    new_currency = portal.currency_module.newContent(
+    new_currency = self.portal.currency_module.newContent(
                 portal_type='Currency')
     new_currency.setReference('XOF')
     new_currency.setTitle('Francs CFA')
@@ -307,7 +303,7 @@ class TestCurrencyExchangeLine(Accountin
     invoice.AccountingTransaction_convertDestinationPrice(
                         form_id='view')
     line_list = invoice.contentValues(
-           portal_type=portal.getPortalAccountingMovementTypeList())
+           portal_type=self.portal.getPortalAccountingMovementTypeList())
     for line in line_list:
       self.assertEquals(line.getDestinationTotalAssetPrice(),None)
 
@@ -320,10 +316,9 @@ class TestCurrencyExchangeLine(Accountin
       falls into the validity period of the currency exchange line,the
       conversion is done
     """
-    portal = self.getPortal()
     self.organisation_module = self.portal.organisation_module
     self.organisation1 = self.organisation_module.my_organisation
-    new_currency = portal.currency_module.newContent(
+    new_currency = self.portal.currency_module.newContent(
     portal_type='Currency')
     new_currency.setReference('XOF')
     new_currency.setTitle('Francs CFA')
@@ -361,7 +356,7 @@ class TestCurrencyExchangeLine(Accountin
     transaction1.AccountingTransaction_convertDestinationPrice(
                               form_id='view')
     line_list = transaction1.contentValues(
-           portal_type=portal.getPortalAccountingMovementTypeList())
+           portal_type=self.portal.getPortalAccountingMovementTypeList())
     for line in line_list:
       self.assertEquals(line.getDestinationTotalAssetPrice(),None)
     transaction2 = self._makeOne(
@@ -376,7 +371,7 @@ class TestCurrencyExchangeLine(Accountin
     transaction2.AccountingTransaction_convertDestinationPrice(
                   form_id='view')
     line_list = transaction2.contentValues(
-           portal_type=portal.getPortalAccountingMovementTypeList())
+        portal_type=self.portal.getPortalAccountingMovementTypeList())
     for line in line_list:
       if line.getDestinationValue() == self.account_module.goods_purchase:
         self.assertEquals(line.getDestinationInventoriatedTotalAssetDebit(),
@@ -393,10 +388,9 @@ class TestCurrencyExchangeLine(Accountin
       Create a currency exchange line with no reference currency
       and verify that the CEL won't apply for the currency
     """
-    portal = self.getPortal()
     self.organisation_module = self.portal.organisation_module
     self.organisation1 = self.organisation_module.my_organisation
-    new_currency = portal.currency_module.newContent(
+    new_currency = self.portal.currency_module.newContent(
                portal_type='Currency')
     new_currency.setReference('XOF')
     new_currency.setTitle('Francs CFA')
@@ -434,7 +428,7 @@ class TestCurrencyExchangeLine(Accountin
     invoice.AccountingTransaction_convertDestinationPrice(
                            form_id='view')
     line_list = invoice.contentValues(
-           portal_type=portal.getPortalAccountingMovementTypeList())
+           portal_type=self.portal.getPortalAccountingMovementTypeList())
     for line in line_list:
         self.assertEquals(line.getDestinationTotalAssetPrice(),
                  None)
@@ -445,10 +439,9 @@ class TestCurrencyExchangeLine(Accountin
       Create two currency exchange lines with no base and 
       verify that only one of the CEL will apply for the currency
     """
-    portal = self.getPortal()
     self.organisation_module = self.portal.organisation_module
     self.organisation1 = self.organisation_module.my_organisation
-    new_currency = portal.currency_module.newContent(
+    new_currency = self.portal.currency_module.newContent(
                 portal_type='Currency')
     new_currency.setReference('XOF')
     new_currency.setTitle('Francs CFA')
@@ -500,7 +493,7 @@ class TestCurrencyExchangeLine(Accountin
     invoice.AccountingTransaction_convertDestinationPrice(
                            form_id='view')
     line_list = invoice.contentValues(
-           portal_type=portal.getPortalAccountingMovementTypeList())
+        portal_type=self.portal.getPortalAccountingMovementTypeList())
 
     for line in line_list:
       if line.getDestinationValue() == self.account_module.goods_purchase:




More information about the Erp5-report mailing list