[Erp5-report] r7139 - /erp5/trunk/products/ERP5/tests/testInvoice.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed May 10 01:57:21 CEST 2006


Author: jerome
Date: Wed May 10 01:57:16 2006
New Revision: 7139

URL: http://svn.erp5.org?rev=7139&view=rev
Log:
style changes

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

Modified: erp5/trunk/products/ERP5/tests/testInvoice.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testInvoice.py?rev=7139&r1=7138&r2=7139&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInvoice.py (original)
+++ erp5/trunk/products/ERP5/tests/testInvoice.py Wed May 10 01:57:16 2006
@@ -37,7 +37,7 @@
 """
 import os, sys
 if __name__ == '__main__':
-    execfile(os.path.join(sys.path[0], 'framework.py'))
+  execfile(os.path.join(sys.path[0], 'framework.py'))
 
 # Needed in order to have a log file inside the current folder
 os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
@@ -51,10 +51,11 @@
 from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
 from testAccountingRules import TestAccountingRulesMixin
 
-class TestInvoice(TestAccountingRulesMixin,TestPackingListMixin, ERP5TypeTestCase):
+class TestInvoice(TestAccountingRulesMixin,
+                  TestPackingListMixin,
+                  ERP5TypeTestCase):
   """Test invoice are created from orders then packing lists. """
   
- 
   RUN_ALL_TESTS = 1
 
   default_region = "europe/west/france"
@@ -84,11 +85,11 @@
       for cat in cat_string.split("/")[1:] :
         if not cat in path.objectIds() :
           path = path.newContent(
-            portal_type = 'Category',
-            id = cat,
-            immediate_reindex = 1 )
+                    portal_type='Category',
+                    id=cat,
+                    immediate_reindex=1 )
         else:
-          path=path[cat]
+          path = path[cat]
     # check categories have been created
     for cat_string in self.getNeededCategoryList() :
       self.assertNotEquals(None,
@@ -151,29 +152,31 @@
       vat_account = account_module.newContent(id='receivable_vat')
       vat_account.setGap(self.vat_gap)
       portal.portal_workflow.doActionFor(vat_account,
-          'validate_action',wf_id='account_workflow')
-    vat_account=account_module['receivable_vat']
+          'validate_action', wf_id='account_workflow')
+    vat_account = account_module['receivable_vat']
     if not 'sale' in account_module.objectIds():
       sale_account = account_module.newContent(id='sale')
       sale_account.setGap(self.sale_gap)
       portal.portal_workflow.doActionFor(sale_account,
-          'validate_action',wf_id='account_workflow')
-    sale_account=account_module['sale']
+          'validate_action', wf_id='account_workflow')
+    sale_account = account_module['sale']
     if not 'customer' in account_module.objectIds():
       customer_account = account_module.newContent(id='customer')
       customer_account.setGap(self.customer_gap)
       portal.portal_workflow.doActionFor(customer_account,
-          'validate_action',wf_id='account_workflow')
-    customer_account=account_module['customer']
-    
-    invoice_rule = self.getPortal().portal_rules.default_invoice_transaction_rule
-    invoice_rule.deleteContent([x.getId() for x in invoice_rule.objectValues()])
+          'validate_action', wf_id='account_workflow')
+    customer_account = account_module['customer']
+    
+    invoice_rule = self.getPortal().portal_rules\
+                          .default_invoice_transaction_rule
+    invoice_rule.deleteContent([x.getId()
+                          for x in invoice_rule.objectValues()])
     region_predicate = invoice_rule.newContent(portal_type = 'Predicate')
     product_line_predicate = invoice_rule.newContent(portal_type = 'Predicate')
     region_predicate.edit(
       membership_criterion_base_category_list = ['destination_region'],
       membership_criterion_category_list =
-                             ['destination_region/region/%s' % self.default_region ],
+                   ['destination_region/region/%s' % self.default_region ],
       int_index = 1,
       string_index = 'region'
     )
@@ -204,7 +207,8 @@
     collected_vat.setQuantity(self.vat_rate)
     collected_vat.setSourceValue(vat_account)
     
-  def modifyPackingListState(self, transition_name, sequence,packing_list=None):
+  def modifyPackingListState(self, transition_name,
+                             sequence,packing_list=None):
     """ calls the workflow for the packing list """
     if packing_list is None:
       packing_list = sequence.get('packing_list')
@@ -217,7 +221,8 @@
     packing_list = sequence.get('packing_list')
     self.assertEquals(packing_list.getSimulationState(), 'ready')
 
-  def stepSetReadyNewPackingList(self, sequence=None, sequence_list=None, **kw):
+  def stepSetReadyNewPackingList(self, sequence=None,
+                                 sequence_list=None, **kw):
     """ set the Packing List as Ready. This must build the invoice. """
     packing_list = sequence.get('new_packing_list')
     self.modifyPackingListState('set_ready_action', sequence=sequence,
@@ -271,7 +276,7 @@
     related_applied_rule_list = packing_list.getCausalityRelatedValueList(
                                    portal_type=self.applied_rule_portal_type)
     related_invoice_list = packing_list.getCausalityRelatedValueList(
-                                   portal_type=self.sale_invoice_transaction_portal_type)
+                     portal_type=self.sale_invoice_transaction_portal_type)
 
     packing_list_building_state = 'started'
     packing_list_state = packing_list.getSimulationState()
@@ -556,7 +561,8 @@
     portal.portal_workflow.doActionFor(new_invoice,
         'confirm_action',wf_id='accounting_workflow')
 
-  def stepCheckTwoInvoicesTransactionLines(self,sequence=None, sequence_list=None, **kw):
+  def stepCheckTwoInvoicesTransactionLines(self,sequence=None,
+                                           sequence_list=None, **kw):
     """ checks invoice properties are well set. """
     invoice = sequence.get('invoice')
     new_invoice = sequence.get('new_invoice')
@@ -593,9 +599,9 @@
       'receivable_vat' : total_price * self.vat_rate,
       'customer' : - (total_price + total_price * self.vat_rate)
       }
-    self.failIfDifferentSet(expected_dict.keys(),found_dict.keys())
+    self.failIfDifferentSet(expected_dict.keys(), found_dict.keys())
     for key in found_dict.keys():
-      self.assertAlmostEquals(expected_dict[key],found_dict[key],places=2)
+      self.assertAlmostEquals(expected_dict[key], found_dict[key], places=2)
 
 
 
@@ -755,7 +761,8 @@
       stepRebuildAndCheckNothingIsCreated
     """)
 
-  def DISABLEDtest_InvoiceDeletePackingListLine(self, quiet=0, run=RUN_ALL_TESTS):
+  def DISABLEDtest_InvoiceDeletePackingListLine(self, quiet=0,
+                                                run=RUN_ALL_TESTS):
     """Checks that deleting a Packing List Line still creates a correct
     Invoice"""
     for base_sequence in (TestInvoice.PACKING_LIST_DEFAULT_SEQUENCE, ) :




More information about the Erp5-report mailing list