You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
995 B

# -*- coding: utf-8 -*-
# © 2014-2015 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import openerp.tests.common as common
from ..models.mis_report import _utc_midnight
class TestUtcMidnight(common.TransactionCase):
def test_utc_midnight(self):
date_to_convert = '2014-07-05'
date_time_convert = _utc_midnight(
date_to_convert, 'Europe/Brussels')
self.assertEqual(date_time_convert, '2014-07-04 22:00:00')
date_time_convert = _utc_midnight(
date_to_convert, 'Europe/Brussels', add_day=1)
self.assertEqual(date_time_convert, '2014-07-05 22:00:00')
date_time_convert = _utc_midnight(
date_to_convert, 'US/Pacific')
self.assertEqual(date_time_convert, '2014-07-05 07:00:00')
date_time_convert = _utc_midnight(
date_to_convert, 'US/Pacific', add_day=1)
self.assertEqual(date_time_convert, '2014-07-06 07:00:00')