also cover unregistering

This commit is contained in:
Matthias 2022-05-03 22:13:29 +02:00
parent 08e278232b
commit a357c4ef88
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)
# test unregistering
plg.unregister_tasks()
scheduled_plugin_tasks = Schedule.objects.filter(name__istartswith="plugin.")
self.assertEqual(len(scheduled_plugin_tasks), 0)
def test_calling(self):
"""check if a function can be called without errors"""
self.assertEqual(call_function('schedule', 'member_func'), False)