add cronjob

This commit is contained in:
Frederik Jaeckel 2024-02-27 22:40:59 +01:00
parent 132fcbb0d5
commit 9f3e33d225
11 changed files with 339 additions and 168 deletions

View file

@ -207,4 +207,19 @@ class PlannerTestCase(object):
'setpos': 5, 'monthday': None, 'weekday': '2',
'end_date': None}])
@with_transaction()
def test_planner_create_update_nextrun(self):
""" create job, check nextrun-record
"""
Planner = Pool().get('cashbook.planner')
job = self.prep_create_job()
self.assertEqual(
job._compute_dates_by_rrule(
count=1, start_date=date(2022, 5, 1)), [
date(2022, 5, 1)])
job.update_next_occurence([job])
self.assertEqual(len(job.nextrun), 1)
# end PlannerTestCase