[Erp5-report] r33428 kazuhiko - /erp5/trunk/products/ERP5/tests/testERP5Simulation.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Mar 5 10:00:18 CET 2010


Author: kazuhiko
Date: Fri Mar  5 10:00:17 2010
New Revision: 33428

URL: http://svn.erp5.org?rev=33428&view=rev
Log:
reuse existing rule instead of copy and paste, to avoide Unauthorized error triggered by interaction workflow.

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

Modified: erp5/trunk/products/ERP5/tests/testERP5Simulation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5Simulation.py?rev=33428&r1=33427&r2=33428&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Simulation.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Simulation.py [utf8] Fri Mar  5 10:00:17 2010
@@ -76,11 +76,12 @@
         account.setGap(account_gap)
         account.setAccountType(account_type)
         portal.portal_workflow.doActionFor(account, 'validate_action')
-    portal_rules = portal.portal_rules
-    clipboard = portal_rules.manage_copyObjects(ids=['new_invoice_transaction_simulation_rule'])
-    pasted = portal_rules.manage_pasteObjects(clipboard)
-    invoice_rule = getattr(portal_rules, pasted[0]['new_id'])
-
+    invoice_rule = portal.portal_rules.new_invoice_transaction_simulation_rule
+    if invoice_rule.getValidationState() == 'validated':
+      invoice_rule.invalidate()
+    invoice_rule.deleteContent(list(invoice_rule.contentIds(filter={'portal_type':['Predicate', 'Accounting Rule Cell']})))
+    transaction.commit()
+    self.tic()
     region_predicate = invoice_rule.newContent(portal_type = 'Predicate')
     product_line_predicate = invoice_rule.newContent(portal_type = 'Predicate')
     region_predicate.edit(




More information about the Erp5-report mailing list