[IMP] make failure of rpc cleanup fail the owning test

bzr revid: xmo@openerp.com-20121030081525-i611as22kjlhcex5
This commit is contained in:
Xavier Morel
2012-10-30 09:15:25 +01:00
parent d2cf844e7b
commit 5b1990bd18
+17 -8
View File
@@ -299,20 +299,29 @@ openerp.testing = {};
+ "number of assertions they expect");
}
}
return $.when(result).fail(function (error) {
if (options.fail_on_rejection === false) {
return;
}
ok(false, typeof error === 'object' && error.message
? error.message
: JSON.stringify([].slice.call(arguments)));
})
return $.when(result);
}).pipe(function () {
return opts.teardown(instance, $fixture, mock);
}, function () {
return opts.teardown(instance, $fixture, mock);
}).always(function () {
start();
}).fail(function (error) {
if (options.fail_on_rejection === false) {
return;
}
var message;
if (typeof error !== 'object'
|| typeof error.message !== 'string') {
message = JSON.stringify([].slice.apply(arguments));
} else {
message = error.message;
if (error.data && error.data.debug) {
message += '\n\n' + error.data.debug;
}
}
ok(false, message);
});
});
};