Commit e46d98c6 authored by Romain Courteaud's avatar Romain Courteaud

Test getVariationTest on SimulationMovement.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2854 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 05e4a3a6
...@@ -359,7 +359,8 @@ class TestOrder(ERP5TypeTestCase): ...@@ -359,7 +359,8 @@ class TestOrder(ERP5TypeTestCase):
portal_type=self.cell_portal_type, *cell_key) portal_type=self.cell_portal_type, *cell_key)
cell.edit(mapped_value_property_list=['price','quantity'], cell.edit(mapped_value_property_list=['price','quantity'],
price=price, quantity=quantity) price=price, quantity=quantity)
cell.setPredicateCategoryList( cell_key ) cell.setPredicateCategoryList(cell_key)
cell.setVariationCategoryList(cell_key)
price += 1 price += 1
quantity += 1 quantity += 1
...@@ -1005,6 +1006,16 @@ class TestOrder(ERP5TypeTestCase): ...@@ -1005,6 +1006,16 @@ class TestOrder(ERP5TypeTestCase):
order_line = sequence.get('order_line') order_line = sequence.get('order_line')
cell = order_line.getCellValueList()[0] cell = order_line.getCellValueList()[0]
self.checkAcquisition(cell, order_line) self.checkAcquisition(cell, order_line)
# Test resource
self.assertEquals(order_line.getResource(), \
cell.getResource())
# Test resource variation
cvcl = cell.getVariationCategoryList()
olvcl = order_line.getVariationCategoryList()
self.assertEquals(len(order_line.getVariationRangeBaseCategoryList()), \
len(cvcl))
for variation_category in cvcl:
self.failUnless(variation_category in olvcl)
def test_11_testPropertiesAcquisition(self, quiet=0, run=run_all_test): def test_11_testPropertiesAcquisition(self, quiet=0, run=run_all_test):
""" """
...@@ -1088,6 +1099,9 @@ class TestOrder(ERP5TypeTestCase): ...@@ -1088,6 +1099,9 @@ class TestOrder(ERP5TypeTestCase):
# Test resource # Test resource
self.assertEquals(order_movement.getResource(), \ self.assertEquals(order_movement.getResource(), \
simulation_movement.getResource()) simulation_movement.getResource())
# Test resource variation
self.assertEquals(order_movement.getVariationText(), \
simulation_movement.getVariationText())
# XXX Test acquisition # XXX Test acquisition
self.checkAcquisition(simulation_movement, order_movement) self.checkAcquisition(simulation_movement, order_movement)
# Test other attributes # Test other attributes
......
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