diff options
| author | Christophe Simonis <chs@openerp.com> | 2013-10-31 12:19:45 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2013-10-31 12:19:45 +0100 |
| commit | 12e262e5c97d7f4faf411dcb4bf8815ad437b078 (patch) | |
| tree | 427d37edd2c9d03bdbbd5732d8c5c0beb971777e /addons/web/static/test/framework.js | |
| parent | d9ca5363961e465ce43ac75f7ba26c977880005d (diff) | |
[FIX] web: correct "date(time) on 31" tests
bzr revid: chs@openerp.com-20131031111945-u3wi11e4rykpslme
Diffstat (limited to 'addons/web/static/test/framework.js')
| -rw-r--r-- | addons/web/static/test/framework.js | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/addons/web/static/test/framework.js b/addons/web/static/test/framework.js index 88bc413a279..237bdc195ca 100644 --- a/addons/web/static/test/framework.js +++ b/addons/web/static/test/framework.js @@ -427,12 +427,15 @@ ropenerp.testing.section('server-formats', { date3.getUTCHours(), date3.getUTCMinutes(), date3.getUTCSeconds(), date3.getUTCMilliseconds()], [2009, 5 - 1, 4, 12, 34, 23, 845]); }); - test('Parse server datetime on 31', function() { + test('Parse server datetime on 31', {asserts: 1}, function() { var wDate = window.Date; - var s = openerp.testing.Stack(); + var s = ropenerp.testing.Stack(); return s.push(function() { - window.Date = function() { - return wDate('2013-10-31 12:34:56'); + window.Date = function(v) { + if (_.isUndefined(v)) { + v = '2013-10-31 12:34:56'; + } + return new wDate(v); }; }, function() { window.Date = wDate; @@ -452,21 +455,24 @@ ropenerp.testing.section('server-formats', { [date.getFullYear(), date.getMonth(), date.getDate()], [2009, 5 - 1, 4]); }); - test('Parse server date on 31', function() { + test('Parse server date on 31', {asserts: 1}, function() { var wDate = window.Date; - var s = openerp.testing.Stack(); + var s = ropenerp.testing.Stack(); return s.push(function() { - window.Date = function() { - return wDate('2013-10-31 12:34:56'); + window.Date = function(v) { + if (_.isUndefined(v)) { + v = '2013-10-31 12:34:56'; + } + return new wDate(v); }; }, function() { window.Date = wDate; }).execute(function() { - return openerp.str_to_date('2013-11-11'); + return openerp.str_to_date('2013-11-21'); }).then(function(date) { deepEqual( [date.getFullYear(), date.getMonth(), date.getDate()], - [2013, 11 - 1, 11]); + [2013, 11 - 1, 21]); }); }); |
