Commit d70b9aa7 authored by Alexandre Boeglin's avatar Alexandre Boeglin

Updated order_cell_portal_type to match change of erp5_trade as r7203.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7204 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c72a8d9e
...@@ -63,7 +63,7 @@ class TestOrderMixin: ...@@ -63,7 +63,7 @@ class TestOrderMixin:
resource_portal_type = 'Apparel Model' resource_portal_type = 'Apparel Model'
order_portal_type = 'Sale Order' order_portal_type = 'Sale Order'
order_line_portal_type = 'Sale Order Line' order_line_portal_type = 'Sale Order Line'
cell_portal_type = 'Delivery Cell' order_cell_portal_type = 'Sale Order Cell'
applied_rule_portal_type = 'Applied Rule' applied_rule_portal_type = 'Applied Rule'
datetime = DateTime() datetime = DateTime()
packing_list_portal_type = 'Sale Packing List' packing_list_portal_type = 'Sale Packing List'
...@@ -261,7 +261,7 @@ class TestOrderMixin: ...@@ -261,7 +261,7 @@ class TestOrderMixin:
base_id = 'movement' base_id = 'movement'
# vcl = list(order_line.getVariationCategoryList()) # vcl = list(order_line.getVariationCategoryList())
# cell_key_list = order_line.getCellKeyList(base_id=base_id) # cell_key_list = order_line.getCellKeyList(base_id=base_id)
cell_list = order_line.objectValues(portal_type=self.cell_portal_type) cell_list = order_line.objectValues(portal_type=self.order_cell_portal_type)
# self.failIfDifferentSet( vcl , [] ) # self.failIfDifferentSet( vcl , [] )
# self.failIfDifferentSet( cell_key_list , [] ) # self.failIfDifferentSet( cell_key_list , [] )
self.failIfDifferentSet( cell_list , [] ) self.failIfDifferentSet( cell_list , [] )
...@@ -287,7 +287,7 @@ class TestOrderMixin: ...@@ -287,7 +287,7 @@ class TestOrderMixin:
Delete the current order line matrix Delete the current order line matrix
""" """
order_line = sequence.get('order_line') order_line = sequence.get('order_line')
cell_list = order_line.objectValues(portal_type=self.cell_portal_type) cell_list = order_line.objectValues(portal_type=self.order_cell_portal_type)
order_line.deleteContent( map(lambda x: x.getId(), cell_list) ) order_line.deleteContent( map(lambda x: x.getId(), cell_list) )
def stepSetOrderLineEmptyVCL(self,sequence=None, sequence_list=None, **kw): def stepSetOrderLineEmptyVCL(self,sequence=None, sequence_list=None, **kw):
...@@ -369,7 +369,7 @@ class TestOrderMixin: ...@@ -369,7 +369,7 @@ class TestOrderMixin:
quantity = 200 quantity = 200
for cell_key in cell_key_list: for cell_key in cell_key_list:
cell = order_line.newCell(base_id=base_id, \ cell = order_line.newCell(base_id=base_id, \
portal_type=self.cell_portal_type, *cell_key) portal_type=self.order_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,
predicate_category_list=cell_key, predicate_category_list=cell_key,
...@@ -386,14 +386,14 @@ class TestOrderMixin: ...@@ -386,14 +386,14 @@ class TestOrderMixin:
base_id = 'movement' base_id = 'movement'
cell_key_list = list(order_line.getCellKeyList(base_id=base_id)) cell_key_list = list(order_line.getCellKeyList(base_id=base_id))
cell_key_list.sort() cell_key_list.sort()
cell_list = order_line.objectValues(portal_type=self.cell_portal_type) cell_list = order_line.objectValues(portal_type=self.order_cell_portal_type)
self.assertEquals(len(cell_list), len(cell_key_list)) self.assertEquals(len(cell_list), len(cell_key_list))
price = 100 price = 100
quantity = 200 quantity = 200
for cell_key in cell_key_list: for cell_key in cell_key_list:
self.failUnless(order_line.hasCell(base_id=base_id, *cell_key)) self.failUnless(order_line.hasCell(base_id=base_id, *cell_key))
cell = order_line.getCell(base_id=base_id, *cell_key) cell = order_line.getCell(base_id=base_id, *cell_key)
self.assertEquals(self.cell_portal_type, cell.getPortalType()) self.assertEquals(self.order_cell_portal_type, cell.getPortalType())
# XXX How can I check the cell content ? # XXX How can I check the cell content ?
# self.assertEquals(price , cell.getProperty('price')) # self.assertEquals(price , cell.getProperty('price'))
# self.assertEquals(quantity, cell.getProperty('quantity')) # self.assertEquals(quantity, cell.getProperty('quantity'))
...@@ -577,7 +577,7 @@ class TestOrderMixin: ...@@ -577,7 +577,7 @@ class TestOrderMixin:
""" """
order = sequence.get('order') order = sequence.get('order')
order_line = sequence.get('order_line') order_line = sequence.get('order_line')
cell_list = order_line.objectValues(portal_type=self.cell_portal_type) cell_list = order_line.objectValues(portal_type=self.order_cell_portal_type)
for cell in cell_list: for cell in cell_list:
self.assertEquals(order.getSimulationState(), cell.getSimulationState()) self.assertEquals(order.getSimulationState(), cell.getSimulationState())
...@@ -672,7 +672,7 @@ class TestOrderMixin: ...@@ -672,7 +672,7 @@ class TestOrderMixin:
movement_list.append(order_line) movement_list.append(order_line)
else: else:
cell_list = order_line.objectValues( \ cell_list = order_line.objectValues( \
portal_type=self.cell_portal_type) portal_type=self.order_cell_portal_type)
movement_list.extend(map(lambda x: x.getObject(), cell_list)) movement_list.extend(map(lambda x: x.getObject(), cell_list))
# Check if number of movement is equal to number of simulation movement # Check if number of movement is equal to number of simulation movement
self.assertEquals(len(movement_list), len(simulation_movement_list)) self.assertEquals(len(movement_list), len(simulation_movement_list))
...@@ -881,7 +881,7 @@ class TestOrderMixin: ...@@ -881,7 +881,7 @@ class TestOrderMixin:
Modify order cell start date Modify order cell start date
""" """
order_line = sequence.get('order_line') order_line = sequence.get('order_line')
cell_list = order_line.objectValues(portal_type=self.cell_portal_type) cell_list = order_line.objectValues(portal_type=self.order_cell_portal_type)
if len(cell_list) > 0: if len(cell_list) > 0:
order_cell = cell_list[0].getObject() order_cell = cell_list[0].getObject()
order_cell.setStartDate(self.datetime + 99) order_cell.setStartDate(self.datetime + 99)
......
...@@ -51,7 +51,7 @@ class TestPurchaseOrder(TestOrder): ...@@ -51,7 +51,7 @@ class TestPurchaseOrder(TestOrder):
run_all_test = 1 run_all_test = 1
order_portal_type = 'Purchase Order' order_portal_type = 'Purchase Order'
order_line_portal_type = 'Purchase Order Line' order_line_portal_type = 'Purchase Order Line'
cell_portal_type = 'Delivery Cell' order_cell_portal_type = 'Purchase Order Cell'
packing_list_portal_type = 'Purchase Packing List' packing_list_portal_type = 'Purchase Packing List'
packing_list_line_portal_type = 'Purchase Packing List Line' packing_list_line_portal_type = 'Purchase Packing List Line'
packing_list_cell_portal_type = 'Purchase Packing List Cell' packing_list_cell_portal_type = 'Purchase Packing List Cell'
......
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