Commit f27e3494 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Fix getAggregatedAmountList call

The method expects an IAmount as context: it does not make sense to use a
Transformation.
The proper way is to create a TempAmount containing the resource, quantity and
variation properties that one wants.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33832 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5a3a589a
......@@ -615,9 +615,17 @@ class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase):
"""
Verify aggregated data according to an expected structure
"""
for expected in expected_list:
aggregated_amount_list = transformation.getAggregatedAmountList(
context=transformation.asContext(categories = expected['id']) )
from Products.ERP5Type.Document import newTempAmount
produced_resource = transformation.getResource()
for i, expected in enumerate(expected_list):
context = newTempAmount(transformation, "temp_amount_%s" % i)
context.edit(
quantity = 1.0,
variation_category_list = expected['id'],
resource = produced_resource,
)
aggregated_amount_list = transformation.getAggregatedAmountList(context)
expected_amount_list = expected['amount']
# Check the number of aggregated components
......
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