also cover errors

This commit is contained in:
Matthias 2022-05-03 22:15:24 +02:00
parent a357c4ef88
commit 626e3838ae
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -29,6 +29,11 @@ class ScheduledTaskPluginTests(TestCase):
scheduled_plugin_tasks = Schedule.objects.filter(name__istartswith="plugin.")
self.assertEqual(len(scheduled_plugin_tasks), 3)
# delete middle task
# this is to check the system also deals with disappearing tasks
scheduled_plugin_tasks[1].delete()
self.assertEqual(len(scheduled_plugin_tasks), 2)
# test unregistering
plg.unregister_tasks()
scheduled_plugin_tasks = Schedule.objects.filter(name__istartswith="plugin.")