Community mailing list archives

community@mail.odoo.com

Re: unit testing odoo constraint

by
Apertoso, Jos De Graeve
- 06/04/2015 11:52:21

2015-06-04 16:27 GMT+02:00 Nicolas Schmitt <n.schmitt@protelcotelsa.com>:
The best way I have found to use the assertRaises is using it like this:

with self.assertRaises(ExceptionType):
    # code that should raise the error

Tell me how it goes.

Thanks,  that fixed it.

Regards,
Jos De Graeve - Apertoso business ICT


Guido Gezellelaan 16 - B-9800 Deinze - Belgium
 
Direct: +32 9 381 64 51
General:+32 9 381 64 50
Mobile: +32 475 54 68 80
mail/im/skype: Jos.DeGraeve@apertoso.be - apertoso