Test on forecast record name fails after 31 March 2023

The test was added with 3b15c1378292 but as there is a computed active field
on forecast based on the "to date", the search by record name does not find
any active record.
This commit is contained in:
Cédric Krier
2023-04-03 01:17:03 +02:00
parent 9de4a7627e
commit 40cc20121b
+3 -2
View File
@@ -10,7 +10,7 @@ from trytond.modules.company.tests import (
CompanyTestMixin, create_company, set_company)
from trytond.pool import Pool
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
from trytond.transaction import Transaction
from trytond.transaction import Transaction, inactive_records
class StockForecastTestCase(CompanyTestMixin, ModuleTestCase):
@@ -35,7 +35,8 @@ class StockForecastTestCase(CompanyTestMixin, ModuleTestCase):
to_date=datetime.date(2023, 3, 31),
)
forecast.save()
forecasts = Forecast.search([('rec_name', '=', "Warehouse")])
with inactive_records():
forecasts = Forecast.search([('rec_name', '=', "Warehouse")])
self.assertEqual(
forecast.rec_name,