diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-06-29 11:30:09 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2017-06-29 11:34:43 +0200 |
| commit | 514c8e5cd3adeed1427745a80ee6d368bda63692 (patch) | |
| tree | a0859048a7de735f763347220f998e4d7246b8c8 /addons/web/static/tests/fields/basic_fields_tests.js | |
| parent | ec3bc2eeaf88c957340615ed0da71ac7b91a596b (diff) | |
[FIX] web: prevent dirty state after test
The test changed in this commit had a big issue: it did not properly
destroy the second form view that it created. Because of that, it was
still alive and could interact with other tests, such as the barcode
tests.
This is what happened:
1. var form was assigned to a form view
2. form was destroyed
3. in a try catch, form was reassigned to the result of createView, but
the evaluation of createView crashed (after creating a form view), so the
assignation was not done, and the var form was still pointing to the first
form view
4. form.destroy is called, which did nothing for the second form view.
There is no easy way to get the reference to the form view created by
createView without changing some other code, so we simply remove the
second part of the test, which was not particularly important.
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 50daedb7dcb..c732fe35ce6 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -2115,7 +2115,7 @@ QUnit.module('basic_fields', { }); QUnit.test('integer field in form view with virtual id', function (assert) { - assert.expect(2); + assert.expect(1); var params = { View: FormView, model: 'partner', @@ -2127,15 +2127,7 @@ QUnit.module('basic_fields', { var form = createView(params); assert.strictEqual(form.$('.o_field_widget').text(), "2-20170808020000", "Should display virtual id"); - form.destroy(); - params.res_id = this.data.partner.records[1].id = "2.65-20170808020000"; - try { - form = createView(params); - } catch (error) { - assert.strictEqual(error.message, '"2.65-20170808020000" is not an integer or a virtual id', - "Should throw an exception because it's a wrong value"); - } form.destroy(); }); |
