diff options
| author | Darshan Kalola (OpenERP) <dka@tinyerp.com> | 2014-03-31 15:02:50 +0530 |
|---|---|---|
| committer | Darshan Kalola (OpenERP) <dka@tinyerp.com> | 2014-03-31 15:02:50 +0530 |
| commit | ad99e8cfaebd2d686d48f6d7928ebefaa852d547 (patch) | |
| tree | 28f6b719c4c250b7397c6a39db260d8e91f5c023 /addons/web/static/test/data.js | |
| parent | 48388c9ad4d338050b065bdc0904a2a09ec225af (diff) | |
| parent | fc760dd0d03a07bf0c5833d93b3bcd7566a12e66 (diff) | |
[MERGE]sync with trunk.
bzr revid: dka@tinyerp.com-20140331093250-wq0tgglwqvlgyw53
Diffstat (limited to 'addons/web/static/test/data.js')
| -rw-r--r-- | addons/web/static/test/data.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/addons/web/static/test/data.js b/addons/web/static/test/data.js index d7a957ad920..2228709e8bb 100644 --- a/addons/web/static/test/data.js +++ b/addons/web/static/test/data.js @@ -1,3 +1,32 @@ +openerp.testing.section('data.dataset', { + rpc: 'mock', + dependencies: ['web.data'], +}, function (test) { + test('read_ids', {asserts: 2}, function (instance, _, mock) { + var d = new instance.web.DataSet(null, 'foo'); + mock('foo:read', function (args) { + var ids = args[0]; + deepEqual(ids, [3, 1, 2]); + return [ + {id: 1, a: 'bar'}, + {id: 2, a: 'baz'}, + {id: 3, a: 'foo'} + ]; + }); + + return d.read_ids([3, 1, 2]).then(function (records) { + deepEqual( + records, + [ + {id: 3, a: 'foo'}, + {id: 1, a: 'bar'}, + {id: 2, a: 'baz'} + ] + ) + }); + }) +}); + openerp.testing.section('data.model.group_by', { rpc: 'mock', dependencies: ['web.data'], |
