Community mailing list archives

community@mail.odoo.com

Re: unit testing odoo constraint

by
Vauxoo S.A. de C.V., Moisés Augusto López Calderón
- 06/05/2015 06:39:37
If you use "assertRaisesRegexp" you can add a exactly message that you expected it.


2015-06-04 18:00 GMT+02:00 Jos De Graeve <jos.degraeve@apertoso.be>:

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
 
mail/im/skype: Jos.DeGraeve@apertoso.be - apertoso

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
Moisés López Calderón
Vauxoo - OpenERP's Gold Partner
Mobile: (+521) 477-752-22-30
Office: (+52) 477-773-33-46
web: http://www.vauxoo.com
twitter: @vauxoo
           @moylop260