From c5d395064d4f70ae3b7126261fbf4d7abcebfd2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9gory=20Wisniewski?= <gregory@nexedi.com>
Date: Thu, 3 Dec 2009 12:47:50 +0000
Subject: [PATCH] Create sub-categories for each created site

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31025 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Banking/tests/TestERP5BankingMixin.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Banking/tests/TestERP5BankingMixin.py b/product/ERP5Banking/tests/TestERP5BankingMixin.py
index a69efc73d9..e60d99b745 100644
--- a/product/ERP5Banking/tests/TestERP5BankingMixin.py
+++ b/product/ERP5Banking/tests/TestERP5BankingMixin.py
@@ -627,6 +627,7 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
     salle_tri = surface_vault_type.newContent('salle_tri')
       
     if not no_site:
+      destination_site_list = [x.getId() for x in created_site_list]
       for c in created_site_list: #self.testsite.getCategoryChildValueList():
         # create bank structure for each agency
         site = c.getId()
@@ -665,7 +666,7 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
         for ss in ['encaisse_des_billets_et_monnaies', 'encaisse_des_billets_recus_pour_ventilation', 'encaisse_des_differences', 'encaisse_des_externes']:
           ss =  salle_tri.newContent(id='%s' %(ss,), portal_type='Category', codification='',  vault_type='site/surface/salle_tri')
           if 'ventilation' in ss.getId():
-            for country in ['madrid', 'paris']:
+            for country in destination_site_list:
               if country[0] != c.getCodification()[0]:
                 ss.newContent(id='%s' %(country,), portal_type='Category', codification='',  vault_type='site/caveau/%s' %(s.getId(),))
         # caveau
@@ -676,7 +677,7 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
             for ss in ['encaisse_des_billets_neufs_non_emis', 'encaisse_des_billets_retires_de_la_circulation','encaisse_des_billets_detruits','encaisse_des_billets_neufs_non_emis_en_transit_allant_a']:
               ss =  s.newContent(id='%s' %(ss,), portal_type='Category', codification='',  vault_type='site/caveau/%s' %(s.getId(),))
               if 'transit' in ss.getId():
-                for country in ['madrid', 'paris']:
+                for country in destination_site_list:
                   if country[0] != c.getCodification()[0]:
                     ss.newContent(id='%s' %(country,), portal_type='Category', codification='',  vault_type='site/caveau/%s' %(s.getId(),))
 
@@ -685,7 +686,7 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
                        'encaisse_des_billets_recus_pour_ventilation','encaisse_des_devises']:
               ss =  s.newContent(id='%s' %(ss,), portal_type='Category', codification='',  vault_type='site/caveau/%s' %(s.getId(),))
               if 'ventilation' in ss.getId():
-                for country in ['madrid', 'paris']:
+                for country in destination_site_list:
                   if country[0] != c.getCodification()[0]:
                     ss.newContent(id='%s' %(country,), portal_type='Category', codification='',  vault_type='site/caveau/%s' %(s.getId(),))
               if 'devises' in ss.getId():
-- 
2.30.9