[Erp5-report] r8713 - /erp5/trunk/products/ERP5/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jul 24 10:59:53 CEST 2006


Author: jerome
Date: Mon Jul 24 10:59:47 2006
New Revision: 8713

URL: http://svn.erp5.org?rev=8713&view=rev
Log:
run tests quietly

Modified:
    erp5/trunk/products/ERP5/tests/testAccounting.py
    erp5/trunk/products/ERP5/tests/testAccountingRules.py

Modified: erp5/trunk/products/ERP5/tests/testAccounting.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccounting.py?rev=8713&r1=8712&r2=8713&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Mon Jul 24 10:59:47 2006
@@ -48,6 +48,7 @@
 SOURCE = 'source'
 DESTINATION = 'destination'
 RUN_ALL_TESTS = 1
+QUIET = 1
 
 class TestAccounting(ERP5TypeTestCase):
   """Test Accounting. """
@@ -61,10 +62,10 @@
            getattr(self.getPortal(), 'account', None))
   
   # XXX
-  def playSequence(self, sequence_string) :
+  def playSequence(self, sequence_string, quiet=1) :
     sequence_list = SequenceList()
     sequence_list.addSequenceString(sequence_string)
-    sequence_list.play(self)
+    sequence_list.play(self, quiet=quiet)
   
   account_portal_type           = 'Account'
   accounting_period_portal_type = 'Accounting Period'
@@ -1031,7 +1032,7 @@
   ## Test Methods ############################################################
   ############################################################################
   
-  def test_MultiCurrencyInvoice(self, quiet=0, run=RUN_ALL_TESTS):
+  def test_MultiCurrencyInvoice(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """Basic test for multi currency accounting"""
     if not run : return
     self.playSequence("""
@@ -1043,9 +1044,9 @@
       stepCheckAccountBalanceLocalCurrency
       stepCheckAccountBalanceExternalCurrency
       stepCheckAccountBalanceConvertedCurrency
-    """)
-
-  def test_AccountingPeriod(self, quiet=0, run=RUN_ALL_TESTS):
+    """, quiet=quiet)
+
+  def test_AccountingPeriod(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """Basic test for Accounting Periods"""
     if not run : return
     self.playSequence("""
@@ -1068,10 +1069,10 @@
       stepCheckInvoicesAreDelivered
       stepTic
       stepCheckAccountingTransactionDelivered
-    """)
+    """, quiet=quiet)
   
   def test_AccountingPeriodRefusesWrongDateTransactionValidation(
-        self, quiet=0, run=RUN_ALL_TESTS):
+        self, quiet=QUIET, run=RUN_ALL_TESTS):
     """Accounting Periods prevents transactions to be validated
         when there is no oppened accounting period"""
     if not run : return
@@ -1087,9 +1088,9 @@
       stepCheckStopInvoicesRefused
       stepTic
       stepCheckInvoicesAreDraft
-    """)
-
-  def test_AccountingPeriodNotStoppedTransactions(self, quiet=0,
+    """, quiet=quiet)
+
+  def test_AccountingPeriodNotStoppedTransactions(self, quiet=QUIET,
                                                   run=RUN_ALL_TESTS):
     """Accounting Periods refuse to close when some transactions are
       not stopped"""
@@ -1106,9 +1107,9 @@
       stepCheckAccountingPeriodRefusesClosing
       stepTic
       stepCheckInvoicesAreDraft
-    """)
-
-  def test_AccountingPeriodOtherSections(self, quiet=0,
+    """, quiet=quiet)
+
+  def test_AccountingPeriodOtherSections(self, quiet=QUIET,
                                                   run=RUN_ALL_TESTS):
     """Accounting Periods does not change other section transactions."""
     if not run : return
@@ -1127,9 +1128,9 @@
       stepTic
       stepCheckAccountingPeriodDelivered
       stepCheckInvoicesAreDraft
-    """)
-
-  def test_MirrorAccounts(self, quiet=0, run=RUN_ALL_TESTS):
+    """, quiet=quiet)
+
+  def test_MirrorAccounts(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """Tests using an account on one sides uses the mirror account
     on the other size. """
     if not run : return
@@ -1137,18 +1138,18 @@
       stepCreateEntities
       stepCreateAccounts
       stepCreateAccountingTransactionAndCheckMirrorAccount
-    """)
-
-  def test_Acquisition(self, quiet=0, run=RUN_ALL_TESTS):
+    """, quiet=quiet)
+
+  def test_Acquisition(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """Tests acquisition, categories and portal types are well
     configured. """
     if not run : return
     self.playSequence("""
       stepCreateCurrencies
       stepCheckAcquisition
-      """)
-
-  def test_AccountingTransactionValidationDate(self, quiet=0,
+      """, quiet=quiet)
+
+  def test_AccountingTransactionValidationDate(self, quiet=QUIET,
                                             run=RUN_ALL_TESTS):
     """Transaction validation and dates"""
     if not run : return
@@ -1157,9 +1158,9 @@
       stepCreateCurrencies
       stepCreateAccounts
       stepCreateValidAccountingTransaction
-      stepValidateNoDate""")
-
-  def test_AccountingTransactionValidationSection(self, quiet=0,
+      stepValidateNoDate""", quiet=quiet)
+
+  def test_AccountingTransactionValidationSection(self, quiet=QUIET,
                                              run=RUN_ALL_TESTS):
     """Transaction validation and section"""
     if not run : return
@@ -1168,9 +1169,9 @@
       stepCreateCurrencies
       stepCreateAccounts
       stepCreateValidAccountingTransaction
-      stepValidateNoSection""")
-
-  def test_AccountingTransactionValidationCurrency(self, quiet=0,
+      stepValidateNoSection""", quiet=quiet)
+
+  def test_AccountingTransactionValidationCurrency(self, quiet=QUIET,
                                            run=RUN_ALL_TESTS):
     """Transaction validation and currency"""
     if not run : return
@@ -1179,9 +1180,9 @@
       stepCreateCurrencies
       stepCreateAccounts
       stepCreateValidAccountingTransaction
-      stepValidateNoCurrency""")
-
-  def test_AccountingTransactionValidationAccounts(self, quiet=0,
+      stepValidateNoCurrency""", quiet=quiet)
+
+  def test_AccountingTransactionValidationAccounts(self, quiet=QUIET,
                                            run=RUN_ALL_TESTS):
     """Transaction validation and accounts"""
     if not run : return
@@ -1192,9 +1193,9 @@
       stepCreateValidAccountingTransaction
       stepValidateClosedAccount
       stepCreateValidAccountingTransaction
-      stepValidateNoAccounts""")
-
-  def test_AccountingTransactionValidationBalanced(self, quiet=0,
+      stepValidateNoAccounts""", quiet=quiet)
+
+  def test_AccountingTransactionValidationBalanced(self, quiet=QUIET,
                                               run=RUN_ALL_TESTS):
     """Transaction validation and balance"""
     if not run : return
@@ -1203,9 +1204,9 @@
       stepCreateCurrencies
       stepCreateAccounts
       stepCreateValidAccountingTransaction
-      stepValidateNotBalanced""")
-
-  def test_AccountingTransactionValidationPayment(self, quiet=0,
+      stepValidateNotBalanced""", quiet=quiet)
+
+  def test_AccountingTransactionValidationPayment(self, quiet=QUIET,
                                              run=RUN_ALL_TESTS):
     """Transaction validation and payment"""
     if not run : return
@@ -1215,9 +1216,9 @@
       stepCreateAccounts
       stepCreateValidAccountingTransaction
       stepValidateNoPayment
-    """)
-
-  def test_AccountingTransactionValidationRemoveEmptyLines(self, quiet=0,
+    """, quiet=quiet)
+
+  def test_AccountingTransactionValidationRemoveEmptyLines(self, quiet=QUIET,
                                              run=RUN_ALL_TESTS):
     """Transaction validation removes empty lines"""
     if not run : return
@@ -1227,7 +1228,7 @@
       stepCreateAccounts
       stepCreateValidAccountingTransaction
       stepValidateRemoveEmptyLines
-    """)
+    """, quiet=quiet)
 
 
 if __name__ == '__main__':

Modified: erp5/trunk/products/ERP5/tests/testAccountingRules.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccountingRules.py?rev=8713&r1=8712&r2=8713&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccountingRules.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccountingRules.py Mon Jul 24 10:59:47 2006
@@ -99,13 +99,13 @@
         getattr(self.getPortal(), 'product_module'))
   
   ## XXX move this to "Sequence class"
-  def playSequence(self, sequence_string) :
+  def playSequence(self, sequence_string, quiet=0) :
     sequence_list = SequenceList()
     sequence_list.addSequenceString(sequence_string)
-    sequence_list.play(self)
-
-  
-class TestAccountingRules(TestAccountingRulesMixin,ERP5TypeTestCase):
+    sequence_list.play(self, quiet=quiet)
+
+  
+class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
   """
   This should test the simulation tree and builds starting from the
   invoice.
@@ -113,6 +113,7 @@
   """
 
   RUN_ALL_TESTS = 1
+  QUIET = 1
   RUN_BROKEN_TESTS = os.getenv('RUN_BROKEN_TESTS', 0)
 
   
@@ -149,6 +150,8 @@
             portal_type = 'Category',
             id = cat,
             immediate_reindex = 1 )
+        else:
+          path = getattr(path, cat)
     # check categories have been created
     for cat_string in self.getCategoriesToCreate() :
       self.assertNotEquals(None,
@@ -289,7 +292,7 @@
     )
   
   def stepUpdateSaleInvoiceTransactionRuleMatrix(self, sequence, **kw) :
-    """ creates/updates the matrix of the sale invoice transacction rule """
+    """Creates/updates the matrix of the sale invoice transaction rule """
     invoice_transaction_rule = sequence.get('invoice_transaction_rule')
     base_id = 'movement'
     kwd = {'base_id': base_id}
@@ -1393,7 +1396,7 @@
               accounting_line.getTotalQuantity())
     
     
-  def test_01_HasEverything(self, quiet=0, run=RUN_ALL_TESTS):
+  def test_01_HasEverything(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """ check necessary tools and modules are present. """
     if not run:
       return
@@ -1412,7 +1415,7 @@
     self.failUnless(self.getProductModule() != None)
     self.failUnless(self.getCurrencyModule() != None)
 
-  def test_02_UpdateInvoiceTransactionRuleMatrix(self, quiet=0,
+  def test_02_UpdateInvoiceTransactionRuleMatrix(self, quiet=QUIET,
                                               run=RUN_ALL_TESTS):
     """ test edition of matrix and rule.
     Try to update the matrix after adding some predicates, 
@@ -1434,10 +1437,10 @@
       stepCheckRemovePredicate
       stepTic
       stepCheckRestoreOriginalPredicates
-    """)
+    """, quiet=quiet)
 
   def test_03_invoiceTransactionRule_getMatchingCell(self,
-                                    quiet=0, run=RUN_ALL_TESTS):
+                                    quiet=QUIET, run=RUN_ALL_TESTS):
     """ test predicates for the cells of invoice transaction rule
     """
     if not run:
@@ -1461,9 +1464,9 @@
       stepCheckMatchableSaleInvoiceMovements
       stepCreateNotMatchableSaleInvoiceMovements
       stepCheckNotMatchableSaleInvoiceMovements
-    """)
-  
-  def test_04_SimpleInvoice(self, quiet=0, run=RUN_ALL_TESTS):
+    """, quiet=quiet)
+  
+  def test_04_SimpleInvoice(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """ Simple Invoice.
     Try to expand an invoice containing only one simple Invoice Line.
     Check that the build is correct.
@@ -1494,9 +1497,9 @@
       stepConfirmInvoice
       stepTic
       stepCheckAccountingLinesCoherantWithSimulation
-      """ )
-
-  def test_04b_SimpleInvoiceConfirm(self, quiet=0, run=RUN_ALL_TESTS):
+      """, quiet=quiet )
+
+  def test_04b_SimpleInvoiceConfirm(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """  Same test as SimpleInvoice but directly confirm the invoice
     without planning it """
     if not run:
@@ -1522,9 +1525,9 @@
       stepTic
       stepCheckAccountingLinesCreatedForSimpleInvoice
       stepRebuildAndCheckNothingIsCreated
-      """ )
-  
-  def test_04c_SimpleInvoiceTwoLines(self, quiet=0, run=RUN_ALL_TESTS):
+      """, quiet=quiet )
+  
+  def test_04c_SimpleInvoiceTwoLines(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """ Simple Invoice, 2 lines.
     Same test as SimpleInvoice but use 2 lines of quantity 5 instead of
     1 line of quantity 10.
@@ -1552,9 +1555,9 @@
       stepTic
       stepCheckAccountingLinesCreatedForSimpleInvoice
       stepRebuildAndCheckNothingIsCreated
-      """ )
+      """, quiet=quiet )
       
-  def test_04d_SimpleInvoiceTwoCells(self, quiet=0, run=RUN_ALL_TESTS):
+  def test_04d_SimpleInvoiceTwoCells(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """ Simple Invoice, 2 cells.
     Same test as SimpleInvoice but use 2 cells of quantity 5 instead of
     1 line of quantity 10.
@@ -1582,10 +1585,10 @@
       stepTic
       stepCheckAccountingLinesCreatedForSimpleInvoice
       stepRebuildAndCheckNothingIsCreated
-      """ )
+      """, quiet=quiet )
    
   # next 5 tests will check update of applied rules. 
-  def test_05a_SimpleInvoiceReExpandAddLine(self, quiet=0,
+  def test_05a_SimpleInvoiceReExpandAddLine(self, quiet=QUIET,
         run=RUN_ALL_TESTS):
     """ Add a new line then updateAppliedRule.
     Create an empty invoice, plan, add a line so that this
@@ -1618,9 +1621,9 @@
       stepTic
       stepCheckAccountingLinesCreatedForSimpleInvoice
       stepRebuildAndCheckNothingIsCreated
-      """ )
+      """, quiet=quiet )
       
-  def test_05b_SimpleInvoiceReExpandEditLine(self, quiet=0,
+  def test_05b_SimpleInvoiceReExpandEditLine(self, quiet=QUIET,
               run = RUN_ALL_TESTS):
     """ Tests that editing a line updates simulation correctly """
     if not run:
@@ -1649,10 +1652,10 @@
       stepTic
       stepCheckAccountingLinesCreatedForSimpleInvoice
       stepRebuildAndCheckNothingIsCreated
-      """ )
+      """, quiet=quiet )
 
   def test_05c_SimpleInvoiceReExpandDeleteLine(
-                        self, quiet=0, run=RUN_ALL_TESTS):
+                        self, quiet=QUIET, run=RUN_ALL_TESTS):
     """ Tests that removing a line updates simulation correctly """
     if not run:
       return
@@ -1682,9 +1685,9 @@
       stepTic
       stepCheckAccountingLinesCreatedForSimpleInvoice
       stepRebuildAndCheckNothingIsCreated
-      """ )
+      """, quiet=quiet )
       
-  def test_05d_SimpleInvoiceReExpandCreateCell(self, quiet=0,
+  def test_05d_SimpleInvoiceReExpandCreateCell(self, quiet=QUIET,
                   run=RUN_ALL_TESTS):
     """ Tests that replacing a line by cells updates simulation correctly """
     if not run:
@@ -1713,10 +1716,10 @@
       stepTic
       stepCheckAccountingLinesCreatedForSimpleInvoice
       stepRebuildAndCheckNothingIsCreated
-      """)
+      """, quiet=quiet)
                      
   def test_05e_SimpleInvoiceExpandManyTimes(
-                                self, quiet=0, run=RUN_ALL_TESTS):
+                                self, quiet=QUIET, run=RUN_ALL_TESTS):
     """ Tests that updating an applied rule many times doesn't break the
     build """
     if not run:
@@ -1749,9 +1752,9 @@
       stepTic
       stepCheckAccountingLinesCreatedForSimpleInvoice
       stepRebuildAndCheckNothingIsCreated
-      """ )
-
-  def test_06_MultiLineInvoice(self, quiet=0, run=RUN_ALL_TESTS):
+      """, quiet=quiet )
+
+  def test_06_MultiLineInvoice(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """ Multiple lines invoice.
     Try to expand an invoice containing multiples Invoice Line.
     Check that the build is correct, ie similar movements are aggregated.
@@ -1783,9 +1786,9 @@
       stepTic
       stepCheckAccountingLinesCreatedForMultiLineInvoice
       stepRebuildAndCheckNothingIsCreated
-      """ )
-    
-  def test_07_PaymentRuleForSaleInvoice(self, quiet=0, run=RUN_ALL_TESTS):
+      """, quiet=quiet )
+    
+  def test_07_PaymentRuleForSaleInvoice(self, quiet=QUIET, run=RUN_ALL_TESTS):
     """ Payment Rule.
       checks the payment rule is applied on sale invoice simulation
       movement. """




More information about the Erp5-report mailing list