Commit bbd831a4 authored by Łukasz Nowak's avatar Łukasz Nowak

- remove not needed part of test


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37741 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2c908114
......@@ -103,95 +103,6 @@ class TradeConditionTestCase(ERP5TypeTestCase, SubcontentReindexingWrapper):
portal_type=self.trade_condition_type)
supply_line = trade_condition.newContent(portal_type=self.supply_line_type)
self._testSubContentReindexing(trade_condition, [supply_line])
return
# If trade condition is modified, then supply lines must be reindexed
another_resource = self.portal.product_module.newContent(portal_type='Product',
title='Another Resource')
# Supply lines are made without source_section and destination_section
supply_line_1 = self.trade_condition.newContent(portal_type=self.supply_line_type,
resource_value=self.resource)
supply_line_2 = self.trade_condition.newContent(portal_type=self.supply_line_type,
resource_value=another_resource)
transaction.commit()
self.tic()
# Set source_section and destination_section to trade condition
# Then recursive reindex should be called
self.trade_condition.edit(source_section_value=self.client,
destination_section_value=self.vendor)
transaction.commit()
self.tic()
# New indexes have source_section, destination_section
self.assertEqual(len(self.portal.portal_catalog(portal_type=self.trade_condition_type,
source_section_relative_url=self.client.getRelativeUrl(),
destination_section_relative_url=self.vendor.getRelativeUrl())),
1)
self.assertEqual(len(self.portal.portal_catalog(portal_type=self.supply_line_type,
resource_relative_url=another_resource.getRelativeUrl(),
source_section_relative_url=self.client.getRelativeUrl(),
destination_section_relative_url=self.vendor.getRelativeUrl())),
1)
self.assertEqual(len(self.portal.portal_catalog(portal_type=self.supply_line_type,
resource_relative_url=self.resource.getRelativeUrl(),
source_section_relative_url=self.client.getRelativeUrl(),
destination_section_relative_url=self.vendor.getRelativeUrl())),
1)
# Change source_section and destination_section
company_a = self.portal.organisation_module.newContent(portal_type='Organisation',
title='Company A')
company_b = self.portal.organisation_module.newContent(portal_type='Organisation',
title='Company B')
transaction.commit()
self.tic()
# When edit, recursive reindex should be called
self.trade_condition.edit(source_section_value=None,
destination_section_value=None,
source_value=company_a,
destination_value=company_b)
transaction.commit()
self.tic()
# No old indexes
self.assertEqual(len(self.portal.portal_catalog(portal_type=self.trade_condition_type,
source_section_relative_url=self.client.getRelativeUrl(),
destination_section_relative_url=self.vendor.getRelativeUrl())),
0)
self.assertEqual(len(self.portal.portal_catalog(portal_type=self.supply_line_type,
resource_relative_url=self.resource.getRelativeUrl(),
source_section_relative_url=self.client.getRelativeUrl(),
destination_section_relative_url=self.vendor.getRelativeUrl())),
0)
self.assertEqual(len(self.portal.portal_catalog(portal_type=self.supply_line_type,
resource_relative_url=another_resource.getRelativeUrl(),
source_section_relative_url=self.client.getRelativeUrl(),
destination_section_relative_url=self.vendor.getRelativeUrl())),
0)
# New indexes
self.assertEqual(len(self.portal.portal_catalog(portal_type=self.trade_condition_type,
source_relative_url=company_a.getRelativeUrl(),
destination_relative_url=company_b.getRelativeUrl())),
1)
self.assertEqual(len(self.portal.portal_catalog(portal_type=self.supply_line_type,
resource_relative_url=self.resource.getRelativeUrl(),
source_relative_url=company_a.getRelativeUrl(),
destination_relative_url=company_b.getRelativeUrl())),
1)
self.assertEqual(len(self.portal.portal_catalog(portal_type=self.supply_line_type,
resource_relative_url=another_resource.getRelativeUrl(),
source_relative_url=company_a.getRelativeUrl(),
destination_relative_url=company_b.getRelativeUrl())),
1)
class AccountingBuildTestCase(TradeConditionTestCase):
"""Same as TradeConditionTestCase, but with a rule to generate
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment