Commit 45362f93 authored by Sebastien Robin's avatar Sebastien Robin

testInventory was not working because of a edit with a categories parameter, I...

testInventory was not working because of a edit with a categories parameter, I do not understand how it was possible that it worked one day

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10218 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 96726d69
...@@ -444,15 +444,12 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -444,15 +444,12 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
delivery_line_list.append(packing_list_line) delivery_line_list.append(packing_list_line)
resource_value = resource_list[line['resource']] resource_value = resource_list[line['resource']]
resource_value.setVariationBaseCategoryList(base_category_list) resource_value.setVariationBaseCategoryList(base_category_list)
category_list = packing_list_line.getCategoryList()
variation_category_list = resource_value.getVariationRangeCategoryList(base_category_list=['size']) + \ variation_category_list = resource_value.getVariationRangeCategoryList(base_category_list=['size']) + \
['colour/' + x.getRelativeUrl() for x in resource_value.objectValues(portal_type='Apparel Model Colour Variation')] + \ ['colour/' + x.getRelativeUrl() for x in resource_value.objectValues(portal_type='Apparel Model Colour Variation')] + \
['morphology/' + x.getRelativeUrl() for x in resource_value.objectValues(portal_type='Apparel Model Morphology Variation')] ['morphology/' + x.getRelativeUrl() for x in resource_value.objectValues(portal_type='Apparel Model Morphology Variation')]
packing_list_line.edit( packing_list_line.edit(
resource_value = resource_value, resource_value = resource_value,
default_resource_value = resource_value,
categories = category_list,
variation_category_list=variation_category_list variation_category_list=variation_category_list
) )
...@@ -470,6 +467,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -470,6 +467,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
if len(c.split('/')) == 1: if len(c.split('/')) == 1:
variation[i] = '%s/%s' % (base_category_list[i], resource_value[c].getRelativeUrl()) variation[i] = '%s/%s' % (base_category_list[i], resource_value[c].getRelativeUrl())
new_variation = [] new_variation = []
self.failUnless(len(packing_list_line.getVariationBaseCategoryList())>0)
for bc in packing_list_line.getVariationBaseCategoryList(): for bc in packing_list_line.getVariationBaseCategoryList():
new_variation.append(variation[base_category_dict[bc]]) new_variation.append(variation[base_category_dict[bc]])
variation = new_variation variation = new_variation
......
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