From ebe67cb25ff87492fc837e45a2ad3169e548f9c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Wed, 28 Nov 2012 10:07:01 +0100
Subject: [PATCH] Fixup 6db47987975b3fb2eed49fb5d8baf1f1d9482ba2

Note: for now leave dirty strings, as refactoring is failing in case of too much
manipulation.
---
 .../testSlapOSAccountingRule.py               | 34 ++++++-------------
 master/bt5/slapos_accounting/bt/revision      |  2 +-
 2 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingRule.py b/master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingRule.py
index 058f4e23d..4b48fda6f 100644
--- a/master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingRule.py
+++ b/master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingRule.py
@@ -69,10 +69,9 @@ class TestDefaultInvoiceTransactionRule(testSlapOSMixin):
           use='trade/sale',
           trade_phase='slapos/invoicing',
           quantity_unit='unit/piece',
-          specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
-          causality_list=['business_process_module/slapos_sale_business_p'
-          'rocess/invoice_path', 'business_process_module/slapos_sale_b'
-          'usiness_process/invoice'],
+          specialise=
+              'sale_trade_condition_module/slapos_aggregated_trade_condition',
+          causality_list=['business_process_module/slapos_aggregated_business_process/invoice_path', 'business_process_module/slapos_aggregated_business_process/invoice'],
           delivery_value=self.portal.accounting_module.newContent(
               portal_type='Sale Invoice Transaction').newContent(
                   portal_type='Invoice Line')
@@ -105,11 +104,9 @@ class TestDefaultInvoiceTransactionRule(testSlapOSMixin):
           portal_type='Simulation Movement')
       self.assertEqual(2, len(simulation_movement_list))
       debit_movement_list = [q for q in simulation_movement_list if \
-          q.getCausality() == 'business_process_module/slapos_sale_busines'
-              's_process/account_debit_path']
+          q.getCausality() == 'business_process_module/slapos_aggregated_business_process/account_debit_path']
       credit_movement_list = [q for q in simulation_movement_list if \
-          q.getCausality() == 'business_process_module/slapos_sale_busines'
-              's_process/account_credit_path']
+          q.getCausality() == 'business_process_module/slapos_aggregated_business_process/account_credit_path']
       self.assertEqual(1, len(debit_movement_list))
       self.assertEqual(1, len(credit_movement_list))
       debit_movement = debit_movement_list[0]
@@ -204,9 +201,7 @@ class TestDefaultInvoicingRule(testSlapOSMixin):
           trade_phase='slapos/delivery',
           quantity_unit='unit/piece',
           specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
-          causality_list=['business_process_module/slapos_sale_business_p'
-              'rocess/delivery_path', 'business_process_module/slapos_sale_'
-              'business_process/deliver'])
+          causality_list=['business_process_module/slapos_aggregated_business_process/delivery_path', 'business_process_module/slapos_aggregated_business_process/deliver'])
 
       self.assertEqual('planned',
           root_simulation_movement.getSimulationState())
@@ -266,9 +261,7 @@ class TestDefaultInvoicingRule(testSlapOSMixin):
           simulation_movement.getQuantityUnit())
       self.assertEqual(root_simulation_movement.getSpecialise(),
           simulation_movement.getSpecialise())
-      self.assertEqual(['business_process_module/slapos_sale_business_p'
-          'rocess/invoice_path', 'business_process_module/slapos_sale_b'
-          'usiness_process/invoice'], simulation_movement.getCausalityList())
+      self.assertEqual(['business_process_module/slapos_aggregated_business_process/invoice_path', 'business_process_module/slapos_aggregated_business_process/invoice'], simulation_movement.getCausalityList())
       # check children rules' type
       child_applied_rule_type_list = [q.getSpecialiseReference() for q in \
           simulation_movement.contentValues(portal_type='Applied Rule')]
@@ -322,8 +315,7 @@ class TestDefaultPaymentRule(testSlapOSMixin):
           trade_phase='slapos/accounting',
           quantity_unit='unit/piece',
           specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
-          causality_list=['business_process_module/slapos_sale_busines'
-              's_process/account'],
+          causality_list=['business_process_module/slapos_aggregated_business_process/account'],
           delivery_value=self.portal.accounting_module.newContent(
               portal_type='Sale Invoice Transaction').newContent(
                   portal_type='Invoice Line')
@@ -355,11 +347,9 @@ class TestDefaultPaymentRule(testSlapOSMixin):
           portal_type='Simulation Movement')
       self.assertEqual(2, len(simulation_movement_list))
       debit_movement_list = [q for q in simulation_movement_list if \
-          q.getCausality() == 'business_process_module/slapos_sale_busines'
-              's_process/payment_debit_path']
+          q.getCausality() == 'business_process_module/slapos_aggregated_business_process/payment_debit_path']
       credit_movement_list = [q for q in simulation_movement_list if \
-          q.getCausality() == 'business_process_module/slapos_sale_busines'
-              's_process/payment_credit_path']
+          q.getCausality() == 'business_process_module/slapos_aggregated_business_process/payment_credit_path']
       self.assertEqual(1, len(debit_movement_list))
       self.assertEqual(1, len(credit_movement_list))
       debit_movement = debit_movement_list[0]
@@ -694,9 +684,7 @@ class TestDefaultTradeModelRule(testSlapOSMixin):
           trade_phase='slapos/invoicing',
           quantity_unit='unit/piece',
           specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
-          causality_list=['business_process_module/slapos_sale_business_p'
-          'rocess/invoice_path', 'business_process_module/slapos_sale_b'
-          'usiness_process/invoice'],
+          causality_list=['business_process_module/slapos_aggregated_business_process/invoice_path', 'business_process_module/slapos_aggregated_business_process/invoice'],
           delivery_value=self.portal.accounting_module.newContent(
               portal_type='Sale Invoice Transaction').newContent(
                   portal_type='Invoice Line')
diff --git a/master/bt5/slapos_accounting/bt/revision b/master/bt5/slapos_accounting/bt/revision
index 4701cc793..c663e4d09 100644
--- a/master/bt5/slapos_accounting/bt/revision
+++ b/master/bt5/slapos_accounting/bt/revision
@@ -1 +1 @@
-150
\ No newline at end of file
+151
\ No newline at end of file
-- 
2.30.9