Contributors mailing list archives

contributors@odoo-community.org

Re: unit test of onchange in v10 - full new api

by
Akretion France, David BEAL
- 23/08/2017 08:40:36
found myself

trivial, in fact :-(

record.product_id = new product
record.my_onchange()
assertEquals(record.product_id, product)



Bonne journée


David BEAL - Akretion
Odoo Development / Integration

2017-08-22 18:57 GMT+02:00 David Beal <david.beal@akretion.com>:
Hi guys,

I need your advice about unit test and onchange in v10,

Compared to old api there is a behavior I can't reproduce

In old api we had `def my_onchange (self, cr, ..., product, pricelist, ...)`

For test unit, it's easy just call method by replacing product by the product you want test.

example here


But in new api, there is no more argument in onchange method.
Then i can't understand how can i specify a particular product for my own test.

In OCA test, i haven't found any example where i could understand explicitly
where I put my product value.

For sure expert really could help me here.

Thanks a lot

Bonne journée


David BEAL - Akretion
Odoo Development / Integration