From a28753786cda54b36803bc893287addfcd983df0 Mon Sep 17 00:00:00 2001 From: Albert Cervera i Areny Date: Thu, 10 Jan 2013 23:51:36 +0100 Subject: [PATCH] Use a list of dictionaries in create(). issue2358 review266002 --- tests/test_carrier_percentage.py | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/test_carrier_percentage.py b/tests/test_carrier_percentage.py index b5f7c79710..0a8e43e022 100644 --- a/tests/test_carrier_percentage.py +++ b/tests/test_carrier_percentage.py @@ -49,32 +49,32 @@ class CarrierWeightTestCase(unittest.TestCase): Test compute_percentage. ''' with Transaction().start(DB_NAME, USER, context=CONTEXT): - party = self.party.create({ - 'name': 'Carrier', - }) + party, = self.party.create([{ + 'name': 'Carrier', + }]) uom, = self.uom.search([ ('name', '=', 'Unit'), ]) - category = self.category.create({ - 'name': 'Category', - }) - product = self.product.create({ - 'name': 'Carrier', - 'default_uom': uom.id, - 'category': category.id, - 'type': 'service', - 'list_price': Decimal(0), - 'cost_price': Decimal(0), - }) + category, = self.category.create([{ + 'name': 'Category', + }]) + product, = self.product.create([{ + 'name': 'Carrier', + 'default_uom': uom.id, + 'category': category.id, + 'type': 'service', + 'list_price': Decimal(0), + 'cost_price': Decimal(0), + }]) currency, = self.currency.search([ ('code', '=', 'cu1'), ]) - carrier = self.carrier.create({ - 'party': party.id, - 'carrier_product': product.id, - 'carrier_cost_method': 'percentage', - 'percentage': Decimal(15), - }) + carrier, = self.carrier.create([{ + 'party': party.id, + 'carrier_product': product.id, + 'carrier_cost_method': 'percentage', + 'percentage': Decimal(15), + }]) for amount, price in [ (Decimal(0), Decimal(0)), (Decimal(100), Decimal('15.00')),