diff --git a/product/ERP5Banking/tests/TestERP5BankingMixin.py b/product/ERP5Banking/tests/TestERP5BankingMixin.py index 2a79a5a6b14714981a8b0dbe2b40b42b52535b48..63c447b077dd70f4e005daa774d3979a612636af 100644 --- a/product/ERP5Banking/tests/TestERP5BankingMixin.py +++ b/product/ERP5Banking/tests/TestERP5BankingMixin.py @@ -543,14 +543,17 @@ class TestERP5BankingMixin: self.site_base_category = getattr(self.category_tool, 'site') # add the category testsite in the category site which hold vaults situated in the bank self.testsite = self.site_base_category.newContent(id='testsite', portal_type='Category',codification='TEST',vault_type='site') + created_site_list = [] if len(site_list) != 0: if 'paris' in site_list: self.paris = self.testsite.newContent(id='paris', portal_type='Category', codification='P10', vault_type='site') + created_site_list.append(self.paris) if 'madrid' in site_list: self.madrid = self.testsite.newContent(id='madrid', portal_type='Category', codification='S10', vault_type='site') + created_site_list.append(self.madrid) if 'siege' in site_list: - self.siege = self.testsite.newContent(id='siege', portal_type='Category', codification='HQ1', vault_type='site') - + self.siege = self.site_base_category.newContent(id='siege', portal_type='Category', codification='HQ1', vault_type='site') + created_site_list.append(self.siege) self.vault_type_base_category = getattr(self.category_tool, 'vault_type') site_vault_type = self.vault_type_base_category.newContent(id='site') surface_vault_type = site_vault_type.newContent('surface') @@ -568,7 +571,7 @@ class TestERP5BankingMixin: salle_tri = surface_vault_type.newContent('salle_tri') if not no_site: - for c in self.testsite.getCategoryChildValueList(): + for c in created_site_list: #self.testsite.getCategoryChildValueList(): # create bank structure for each agency site = c.getId() # surface @@ -650,7 +653,7 @@ class TestERP5BankingMixin: if 'madrid' not in site_list: self.madrid = self.testsite.newContent(id='madrid', portal_type='Category', codification='S10', vault_type='site') if 'siege' not in site_list: - self.siege = self.testsite.newContent(id='siege', portal_type='Category', codification='HQ1', vault_type='site') + self.siege = self.site_base_category.newContent(id='siege', portal_type='Category', codification='HQ1', vault_type='site') def _openDate(self, date=None, site=None, id=None, open=True, container=None, portal_type=None): if date is None: diff --git a/product/ERP5Banking/tests/testERP5BankingMutilatedBanknote.py b/product/ERP5Banking/tests/testERP5BankingMutilatedBanknote.py index 1ea02defea97cf137ffb2f05ecb17c4ddf796646..51e7d4e76c8f4822df56cfe8d95a39d226881179 100755 --- a/product/ERP5Banking/tests/testERP5BankingMutilatedBanknote.py +++ b/product/ERP5Banking/tests/testERP5BankingMutilatedBanknote.py @@ -106,11 +106,11 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): self.organisation_1 = self.organisation_module.newContent(id='baobab_org', portal_type='Organisation', function='banking', group='baobab', site='testsite/paris') self.organisation_2 = self.organisation_module.newContent(id='baobab_org_hq', portal_type='Organisation', - function='banking', group='baobab', site='testsite/siege') + function='banking', group='baobab', site='siege') # define the user user_dict = { 'super_user' : [['Manager'], self.organisation_1, 'banking/comptable', 'baobab', 'testsite/paris/surface/banque_interne/guichet_1'], - 'hq_super_user' : [['Manager'], self.organisation_2, 'banking/comptable', 'baobab', 'testsite/siege/surface/banque_interne/guichet_1'] + 'hq_super_user' : [['Manager'], self.organisation_2, 'banking/comptable', 'baobab', 'siege/surface/banque_interne/guichet_1'] } # call method to create this user self.createERP5Users(user_dict) @@ -168,6 +168,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): source_total_asset_price=0.0, destination_total_asset_price=0.0, description='test', + deponent="user", destination_value=self.mutilated_banknote_vault ) self.stepTic() @@ -444,7 +445,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): self.checkBanknoteInventory(node_path=self.hq_maculated_banknote_vault.getRelativeUrl(), quantity=0.0) def stepCreateHQMutilatedBanknote(self, sequence=None, sequence_list=None, - owner_assigned_counter='site/testsite/siege/surface/banque_interne/guichet_1', **kwd): + owner_assigned_counter='site/siege/surface/banque_interne/guichet_1', **kwd): """ Create a mutilated banknote document and check it """ @@ -453,6 +454,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): source_total_asset_price=0.0, destination_total_asset_price=0.0, destination_value=self.hq_mutilated_banknote_vault, + deponent="hq user", causality_value=self.mutilated_banknote ) self.hq_mutilated_banknote.edit(source_trade='site/testsite/paris')