From c3fa3347d58113d1c1ce9364a6af337a2a4a91ab Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 1 Jul 2021 08:55:52 +0000 Subject: [PATCH] [FIX] sale_timesheet: use context_today in test closes odoo/odoo#73050 Signed-off-by: Yannick Tivisse (yti) --- addons/sale_timesheet/tests/test_project_update.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale_timesheet/tests/test_project_update.py b/addons/sale_timesheet/tests/test_project_update.py index a2b15688c93..738a6b9109d 100644 --- a/addons/sale_timesheet/tests/test_project_update.py +++ b/addons/sale_timesheet/tests/test_project_update.py @@ -3,6 +3,7 @@ from datetime import date from dateutil.relativedelta import relativedelta +from odoo import fields from odoo.tests import tagged from odoo.tests.common import Form @@ -24,7 +25,7 @@ class TestProjectUpdateSaleTimesheet(TestProjectUpdate): def test_project_update_description_profitability(self): template_values = self.env['project.update']._get_template_values(self.project_pigs) - today = date.today() + today = fields.Date.context_today(self.project_pigs) self.assertEqual(template_values['profitability']['month'], today.strftime('%B %Y'), "The month used in the template should be well defined") self.assertEqual(template_values['profitability']['previous_month'], (today + relativedelta(months=-1)).strftime('%B'),