[Erp5-report] r45257 leonardo - /erp5/trunk/products/ERP5/tests/testTradeModelLine.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 8 15:22:38 CEST 2011


Author: leonardo
Date: Fri Apr  8 15:22:38 2011
New Revision: 45257

URL: http://svn.erp5.org?rev=45257&view=rev
Log:
Create business links necessary to correctly expand simulation with tax and discount trade phases

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

Modified: erp5/trunk/products/ERP5/tests/testTradeModelLine.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testTradeModelLine.py?rev=45257&r1=45256&r2=45257&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testTradeModelLine.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testTradeModelLine.py [utf8] Fri Apr  8 15:22:38 2011
@@ -469,8 +469,32 @@ class TestTradeModelLine(TestTradeModelL
     taxed = self.createProductTaxed()
     discounted = self.createProductDiscounted()
     taxed_discounted = self.createProductDiscountedTaxed()
+    business_process = self.createBusinessProcess(
+      business_link_list = [
+        dict(reference='discount',
+             trade_phase='default/discount',
+             predecessor='trade_state/invoiced',
+             # should successor be trade_state/discounted? There is no
+             # such trade_state category
+             successor='trade_state/accounted',
+        ),
+        dict(reference='tax',
+             trade_phase='default/tax',
+             predecessor='trade_state/invoiced',
+             # should successor be trade_state/taxed? There IS such a
+             # trade_state category, but the rule that wants to match
+             # the Simulation Movement that has this link as causality
+             # is default_invoice_transaction_rule, the same as for
+             # default/discount, so I'll use the same successor as
+             # above. Besides, we'd have to create a new business_link
+             # just to get back to accounted, and match it with (or
+             # create a new) a portal_rule.
+             successor='trade_state/accounted',
+        ),
+      ],
+    ) 
     trade_condition = self.createTradeCondition(
-      self.createBusinessProcess(), (
+      business_process, (
       dict(price=self.default_discount_ratio,
            base_application='base_amount/discount',
            base_contribution='base_amount/tax',



More information about the Erp5-report mailing list