← Back to team overview

openerp-expert-framework team mailing list archive

Re: Asserting exceptions in YAML tests

 

On Friday 23 September 2011, Georges Racinet wrote:

> - Other ideas ?


savepoints!

test_bqi=> BEGIN;
test_bqi=> SAVEPOINT "foo";
SAVEPOINT
test_bqi=> SELECT * from error;
ERROR:  relation "error" does not exist
LINE 1: SELECT * from error;
                      ^
test_bqi=> SELECT * from error2;
ERROR:  current transaction is aborted, commands ignored until end of 
transaction block
test_bqi=> ROLLBACK TO SAVEPOINT "foo";
ROLLBACK
test_bqi=> SELECT * from res_users;
 id |     name      | active | login ....
.....

They create a "nested" transaction in the sense that we can rollback to the 
point before the validation error.


-- 
Say NO to spam and viruses. Stop using Microsoft Windows!


Follow ups

References