diff --git a/addons/web/static/src/js/testing.js b/addons/web/static/src/js/testing.js
index 094270ec237..e7aad43ffc7 100644
--- a/addons/web/static/src/js/testing.js
+++ b/addons/web/static/src/js/testing.js
@@ -10,7 +10,7 @@ openerp.testing = {};
formats: ['coresetup', 'dates'],
chrome: ['corelib', 'coresetup'],
views: ['corelib', 'coresetup', 'data', 'chrome'],
- search: ['data', 'coresetup', 'formats'],
+ search: ['views', 'formats'],
list: ['views', 'data'],
form: ['data', 'views', 'list', 'formats'],
list_editable: ['list', 'form', 'data'],
diff --git a/addons/web/static/test/list-editable.js b/addons/web/static/test/list-editable.js
index b02e8abed96..89907aa16ee 100644
--- a/addons/web/static/test/list-editable.js
+++ b/addons/web/static/test/list-editable.js
@@ -183,7 +183,7 @@ openerp.testing.section('list.edition', {
}
return [];
});
- mock('/web/view/load', function () {
+ mock('demo:fields_view_get', function () {
return {
type: 'tree',
fields: {
@@ -191,15 +191,7 @@ openerp.testing.section('list.edition', {
b: {type: 'char', string: "B"},
c: {type: 'char', string: "C"}
},
- arch: {
- tag: 'tree',
- attrs: {},
- children: [
- {tag: 'field', attrs: {name: 'a'}},
- {tag: 'field', attrs: {name: 'b'}},
- {tag: 'field', attrs: {name: 'c'}}
- ]
- }
+ arch: '',
};
});
}
@@ -247,7 +239,7 @@ openerp.testing.section('list.edition.events', {
mock('demo:read', function () {
return [{ id: 1, a: 'foo', b: 'bar', c: 'baz' }];
});
- mock('/web/view/load', function () {
+ mock('demo:fields_view_get', function () {
return {
type: 'tree',
fields: {
@@ -255,15 +247,7 @@ openerp.testing.section('list.edition.events', {
b: {type: 'char', string: "B"},
c: {type: 'char', string: "C"}
},
- arch: {
- tag: 'tree',
- attrs: {},
- children: [
- {tag: 'field', attrs: {name: 'a'}},
- {tag: 'field', attrs: {name: 'b'}},
- {tag: 'field', attrs: {name: 'c'}}
- ]
- }
+ arch: '',
};
});
}
@@ -320,19 +304,13 @@ openerp.testing.section('list.edition.onwrite', {
templates: true,
}, function (test) {
test('record-to-read', {asserts: 4}, function (instance, $fix, mock) {
- mock('/web/view/load', function () {
+ mock('demo:fields_view_get', function () {
return {
type: 'tree',
fields: {
a: {type: 'char', string: "A"}
},
- arch: {
- tag: 'tree',
- attrs: { on_write: 'on_write', colors: 'red:a == "foo"' },
- children: [
- {tag: 'field', attrs: {name: 'a'}}
- ]
- }
+ arch: '',
};
});
mock('demo:read', function (args, kwargs) {
diff --git a/addons/web/static/test/list.js b/addons/web/static/test/list.js
index 22c33ef104a..bb4c4c38640 100644
--- a/addons/web/static/test/list.js
+++ b/addons/web/static/test/list.js
@@ -4,20 +4,13 @@ openerp.testing.section('list.buttons', {
templates: true
}, function (test) {
test('record-deletion', {asserts: 2}, function (instance, $fix, mock) {
- mock('/web/view/load', function () {
+ mock('demo:fields_view_get', function () {
return {
type: 'tree',
fields: {
a: {type: 'char', string: "A"}
},
- arch: {
- tag: 'tree',
- attrs: { },
- children: [
- {tag: 'field', attrs: {name: 'a'}},
- {tag: 'button', attrs: {type: 'object', name: 'foo'}}
- ]
- }
+ arch: '',
};
});
mock('demo:read', function (args, kwargs) {
diff --git a/addons/web/static/test/search.js b/addons/web/static/test/search.js
index db9e7aa3ed9..5f177c0a363 100644
--- a/addons/web/static/test/search.js
+++ b/addons/web/static/test/search.js
@@ -152,25 +152,14 @@ var makeSearchView = function (instance, dummy_widget_attributes, defaults) {
instance.dummy = {};
instance.dummy.DummyWidget = instance.web.search.Field.extend(
dummy_widget_attributes || {});
- if (!('/web/view/load' in instance.session.responses)) {
- instance.session.responses['/web/view/load'] = function () {
+ if (!('dummy.model:fields_view_get' in instance.session.responses)) {
+ instance.session.responses['dummy.model:fields_view_get'] = function () {
return {
type: 'search',
fields: {
dummy: {type: 'char', string: "Dummy"}
},
- arch: {
- tag: 'search',
- attrs: {},
- children: [{
- tag: 'field',
- attrs: {
- name: 'dummy',
- widget: 'dummy'
- },
- children: []
- }]
- }
+ arch: ''
};
};
}
@@ -183,7 +172,7 @@ var makeSearchView = function (instance, dummy_widget_attributes, defaults) {
};
};
- var dataset = {model: 'dummy.model', get_context: function () { return {}; }};
+ var dataset = new instance.web.DataSet(null, 'dummy.model');
var view = new instance.web.SearchView(null, dataset, false, defaults);
var self = this;
view.on('invalid_search', self, function () {
@@ -926,31 +915,16 @@ openerp.testing.section('filters', {
rpc: 'mock',
templates: true,
setup: function (instance, $s, mock) {
- mock('/web/view/load', function () {
+ mock('dummy.model:fields_view_get', function () {
// view with a single group of filters
return {
type: 'search',
fields: {},
- arch: {
- tag: 'search',
- attrs: {},
- children: [{
- tag: 'filter',
- attrs: { string: "Foo1", domain: [ ['foo', '=', '1'] ] },
- children: []
- }, {
- tag: 'filter',
- attrs: {
- name: 'foo2',
- string: "Foo2",
- domain: [ ['foo', '=', '2'] ] },
- children: []
- }, {
- tag: 'filter',
- attrs: { string: "Foo3", domain: [ ['foo', '=', '3'] ] },
- children: []
- }]
- }
+ arch: '' +
+ '' +
+ '' +
+ '' +
+ '',
};
});
}