[FIX] web:tests: do not rely on testUtils.patch in tests

Revision on https://github.com/odoo/odoo/commit/10f43955d81ff3e7b5ab050656b312ec19f927c5

Commit above uses `testUtils.patch` in the test.
However, this utility function does not seem to work.

That sucks...
This commit is contained in:
Alexandre Kühn
2018-08-16 18:38:49 +02:00
parent f9644a7674
commit f1a0a32e46
@@ -2018,14 +2018,14 @@ QUnit.module('basic_fields', {
var done = assert.async();
assert.expect(6);
testUtils.patch(JournalDashboardGraph, {
on_attach_callback: function () {
assert.step('on_attach_callback');
},
on_detach_callback: function () {
assert.step('on_detach_callback');
},
});
var originalAttachCallback = JournalDashboardGraph.prototype.on_attach_callback;
var originalDetachCallback = JournalDashboardGraph.prototype.on_detach_callback;
JournalDashboardGraph.prototype.on_attach_callback = function () {
assert.step('on_attach_callback');
};
JournalDashboardGraph.prototype.on_detach_callback = function () {
assert.step('on_detach_callback');
};
createAsyncView({
View: KanbanView,
@@ -2056,7 +2056,8 @@ QUnit.module('basic_fields', {
]);
kanban.destroy();
testUtils.unpatch(JournalDashboardGraph);
JournalDashboardGraph.prototype.on_attach_callback = originalAttachCallback;
JournalDashboardGraph.prototype.on_detach_callback = originalDetachCallback;
done();
});
});