From 6be12f4eb1ebcdb722a04b53359505aadd965306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Fri, 23 Jun 2023 09:35:22 +0200 Subject: [PATCH] [FIX] contract: Set fixed date to check test correctly. We need to set a fixed date for teststest_check_month_name_marker to check against the month of the date we are set (otherwise it would check against the month of today). --- contract/tests/test_contract.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contract/tests/test_contract.py b/contract/tests/test_contract.py index e1a645f72..588444f4b 100644 --- a/contract/tests/test_contract.py +++ b/contract/tests/test_contract.py @@ -2454,6 +2454,10 @@ class TestContract(TestContractBase): self.acct_line.refresh() self.assertEqual(self.acct_line.price_unit, 30.75 * 8) + @freeze_time("2023-05-01") def test_check_month_name_marker(self): + """Set fixed date to check test correctly.""" + self.contract3.contract_line_ids.date_start = fields.Date.today() + self.contract3.contract_line_ids.recurring_next_date = fields.Date.today() invoice_id = self.contract3.recurring_create_invoice() self.assertEqual(invoice_id.invoice_line_ids[0].name, "Header for May Services")