Commit 9772de6b authored by Yusuke Muraoka's avatar Yusuke Muraoka

the cell of a supply line must work as same as the line.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37192 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 804c69d7
......@@ -97,6 +97,14 @@ class TestSaleSupply(TestSupplyMixin, ERP5TypeTestCase):
supply_line.edit(**kw)
return supply_line
@reindex
def _makeSupplyCell(self, supply_line, **kw):
"""Creates a supply cell.
"""
supply_cell = supply_line.newContent(portal_type=self.supply_cell_portal_type)
supply_cell.edit(**kw)
return supply_cell
def test_01_MovementAndSupplyModification(self, quiet=0, run=run_all_test):
"""
Check that moving timeframe of supply
......@@ -111,14 +119,18 @@ class TestSaleSupply(TestSupplyMixin, ERP5TypeTestCase):
start_date_range_max='2009/01/31')
supply_line = self._makeSupplyLine(supply)
supply_cell = self._makeSupplyCell(supply_line)
transaction.commit()
self.tic()
res = self.domain_tool.searchPredicateList(movement,
res_line = self.domain_tool.searchPredicateList(movement,
portal_type=self.supply_line_portal_type)
res_cell = self.domain_tool.searchPredicateList(movement,
portal_type=self.supply_cell_portal_type)
# ...and predicate shall be found
self.assertSameSet(res, [supply_line])
self.assertSameSet(res_line, [supply_line])
self.assertSameSet(res_cell, [supply_cell])
# timeframe is moved out of movement date...
supply.edit(start_date_range_min='2009/02/01',
......@@ -127,11 +139,14 @@ class TestSaleSupply(TestSupplyMixin, ERP5TypeTestCase):
transaction.commit()
self.tic()
res = self.domain_tool.searchPredicateList(movement,
res_line = self.domain_tool.searchPredicateList(movement,
portal_type=self.supply_line_portal_type)
res_cell = self.domain_tool.searchPredicateList(movement,
portal_type=self.supply_cell_portal_type)
# ...and predicate shall NOT be found
self.assertSameSet(res, [])
self.assertSameSet(res_line, [])
self.assertSameSet(res_cell, [])
# movement is going back into timeframe...
movement.edit(start_date='2009/02/15')
......@@ -139,11 +154,14 @@ class TestSaleSupply(TestSupplyMixin, ERP5TypeTestCase):
transaction.commit()
self.tic()
res = self.domain_tool.searchPredicateList(movement,
res_line = self.domain_tool.searchPredicateList(movement,
portal_type=self.supply_line_portal_type)
res_cell = self.domain_tool.searchPredicateList(movement,
portal_type=self.supply_cell_portal_type)
# ...and predicate shall be found
self.assertSameSet(res, [supply_line])
self.assertSameSet(res_line, [supply_line])
self.assertSameSet(res_cell, [supply_cell])
def test_02_checkLineIsReindexedOnSupplyChange(self, quiet=0, run=run_all_test):
"""
......
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