diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-06-27 14:19:31 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-06-27 14:19:31 +0200 |
| commit | dd43071638773dcb58376b79ec7b1456c8b0454d (patch) | |
| tree | fd7935e2aa93de03fa3fe12507f8ef74405a255e /addons/web/static/tests/views/basic_model_tests.js | |
| parent | 6501184e6294ffb06e24a0ec8e9666b79a80b59a (diff) | |
| parent | 278e478d55209bd958836fde7fe1c82c555180dc (diff) | |
[MERGE] forward port branch saas-16 up to 278e478d552
Diffstat (limited to 'addons/web/static/tests/views/basic_model_tests.js')
| -rw-r--r-- | addons/web/static/tests/views/basic_model_tests.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/addons/web/static/tests/views/basic_model_tests.js b/addons/web/static/tests/views/basic_model_tests.js index ca2f6f37f3e..9fbc2acdd88 100644 --- a/addons/web/static/tests/views/basic_model_tests.js +++ b/addons/web/static/tests/views/basic_model_tests.js @@ -92,6 +92,23 @@ QUnit.module('Views', { model.destroy(); }); + QUnit.test('rejects loading a record with invalid id', function (assert) { + assert.expect(1); + + this.params.res_id = 99; + + var model = createModel({ + Model: BasicModel, + data: this.data, + }); + + model.load(this.params).always(function (error) { + assert.strictEqual(this.state(), 'rejected', + "load should return a rejected deferred for an invalid id") + }); + model.destroy(); + }); + QUnit.test('notify change with many2one', function (assert) { assert.expect(2); @@ -1347,8 +1364,8 @@ QUnit.module('Views', { delete this.params.res_id; model.load(this.params).then(function (resultID) { var record = model.get(resultID); - assert.strictEqual(record.data.bar, false, - "should be initialized with correct value"); + assert.strictEqual(record.data.bar, 0, + "should be initialized with correct value (0 as integer)"); model.notifyChanges(resultID, {foo: "anotherverylongstring"}); |
