Use a list of dictionaries in create().

issue2358
review266002
This commit is contained in:
Albert Cervera i Areny committed 2013-01-10 23:51:36 +01:00
1 parent 80cda67906
commit a28753786c
1 file changed
+20 -20
+20 -20
View File
@@ -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')),