[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).
This commit is contained in:
Víctor Martínez
2023-06-23 09:35:22 +02:00
parent b436467aeb
commit 6be12f4eb1

View File

@@ -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")