config: new field 'holidays_info' to show generated holidays in config-form
This commit is contained in:
parent
b54a8d678f
commit
e76ec5792c
5 changed files with 55 additions and 6 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue