config: new field 'holidays_info' to show generated holidays in config-form

This commit is contained in:
Frederik Jaeckel 2024-06-02 10:27:15 +02:00
parent 4f9e6ad1a0
commit e4963beee9
5 changed files with 55 additions and 6 deletions

View file

@ -156,11 +156,15 @@ class PlannerTestCase(object):
Config.holiday_parseconfig(None),
{'definition': '', 'dates': []})
cfg1 = Config(holidays='2022-05-01;easter;whitsun')
cfg1.save()
self.assertEqual(
cfg1.holiday_dates([2022]),
[date(2022, 5, 1), date(2022, 4, 17), date(2022, 6, 5)])
with Transaction().set_context({'holiday_years': [2022]}):
cfg1 = Config(holidays='2022-05-01;easter;whitsun')
cfg1.save()
self.assertEqual(
cfg1.holiday_dates([2022]),
[date(2022, 5, 1), date(2022, 4, 17), date(2022, 6, 5)])
self.assertEqual(
cfg1.holidays_info,
'04/17/2022|05/01/2022|06/05/2022')
@with_transaction()
def test_planner_create_job(self):