diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-10-30 09:15:25 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-10-30 09:15:25 +0100 |
| commit | 5b1990bd18c50fad1aa96e4b8a93eb319dbd8646 (patch) | |
| tree | c3ea009c32309d2b5b417e8e32213e51b344d80e /addons/web/static/src | |
| parent | d2cf844e7b2e447ce0c1502aa3a514056a6d7fb1 (diff) | |
[IMP] make failure of rpc cleanup fail the owning test
bzr revid: xmo@openerp.com-20121030081525-i611as22kjlhcex5
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/testing.js | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/addons/web/static/src/js/testing.js b/addons/web/static/src/js/testing.js index 983c8650e31..32a3624eb93 100644 --- a/addons/web/static/src/js/testing.js +++ b/addons/web/static/src/js/testing.js @@ -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); }); }); }; |
