From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 6 Nov 2025 04:52:45 +0000 (-0800) Subject: Fix scheduled tasks tests X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Ffeature-6978-sharelink-bundle;p=thirdparty%2Fpaperless-ngx.git Fix scheduled tasks tests --- diff --git a/src/paperless/tests/test_settings.py b/src/paperless/tests/test_settings.py index 10995291ed..3d45a176f5 100644 --- a/src/paperless/tests/test_settings.py +++ b/src/paperless/tests/test_settings.py @@ -160,6 +160,7 @@ class TestCeleryScheduleParsing(TestCase): SANITY_EXPIRE_TIME = ((7.0 * 24.0) - 1.0) * 60.0 * 60.0 EMPTY_TRASH_EXPIRE_TIME = 23.0 * 60.0 * 60.0 RUN_SCHEDULED_WORKFLOWS_EXPIRE_TIME = 59.0 * 60.0 + CLEANUP_EXPIRED_SHARE_BUNDLES_EXPIRE_TIME = 23.0 * 60.0 * 60.0 def test_schedule_configuration_default(self): """ @@ -204,6 +205,13 @@ class TestCeleryScheduleParsing(TestCase): "schedule": crontab(minute="5", hour="*/1"), "options": {"expires": self.RUN_SCHEDULED_WORKFLOWS_EXPIRE_TIME}, }, + "Cleanup expired share link bundles": { + "task": "documents.tasks.cleanup_expired_share_link_bundles", + "schedule": crontab(minute=0, hour=2), + "options": { + "expires": self.CLEANUP_EXPIRED_SHARE_BUNDLES_EXPIRE_TIME, + }, + }, }, schedule, ) @@ -256,6 +264,13 @@ class TestCeleryScheduleParsing(TestCase): "schedule": crontab(minute="5", hour="*/1"), "options": {"expires": self.RUN_SCHEDULED_WORKFLOWS_EXPIRE_TIME}, }, + "Cleanup expired share link bundles": { + "task": "documents.tasks.cleanup_expired_share_link_bundles", + "schedule": crontab(minute=0, hour=2), + "options": { + "expires": self.CLEANUP_EXPIRED_SHARE_BUNDLES_EXPIRE_TIME, + }, + }, }, schedule, ) @@ -300,6 +315,13 @@ class TestCeleryScheduleParsing(TestCase): "schedule": crontab(minute="5", hour="*/1"), "options": {"expires": self.RUN_SCHEDULED_WORKFLOWS_EXPIRE_TIME}, }, + "Cleanup expired share link bundles": { + "task": "documents.tasks.cleanup_expired_share_link_bundles", + "schedule": crontab(minute=0, hour=2), + "options": { + "expires": self.CLEANUP_EXPIRED_SHARE_BUNDLES_EXPIRE_TIME, + }, + }, }, schedule, ) @@ -322,6 +344,7 @@ class TestCeleryScheduleParsing(TestCase): "PAPERLESS_INDEX_TASK_CRON": "disable", "PAPERLESS_EMPTY_TRASH_TASK_CRON": "disable", "PAPERLESS_WORKFLOW_SCHEDULED_TASK_CRON": "disable", + "PAPERLESS_SHARE_LINK_BUNDLE_CLEANUP_CRON": "disable", }, ): schedule = _parse_beat_schedule()