2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

Task improvements (#5159)

* Ignore triggered events if plugin events are not enabled

* Ensure that plugin tasks are handled by the background worker

* Allow shell access

* Don't force async if testing

* Enable plugin events as part of CI

* fix
This commit is contained in:
Oliver
2023-07-04 23:26:19 +10:00
committed by GitHub
parent 4c3dc6ddbd
commit 7ba26ebfbb
2 changed files with 19 additions and 1 deletions

View File

@ -3,6 +3,7 @@
from django.conf import settings
from django.test import TestCase
from common.models import InvenTreeSetting
from plugin import InvenTreePlugin, registry
from plugin.base.event.events import trigger_event
from plugin.helpers import MixinNotImplementedError
@ -21,6 +22,8 @@ class EventPluginSampleTests(TestCase):
config.active = True
config.save()
InvenTreeSetting.set_setting('ENABLE_PLUGINS_EVENTS', True, change_user=None)
# Enable event testing
settings.PLUGIN_TESTING_EVENTS = True
# Check that an event is issued