From 5272b56d04e54731ee53aabc40f1df53603be585 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 13 Nov 2021 01:15:20 +0100 Subject: [PATCH] activate plugins if testing --- InvenTree/plugin/apps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InvenTree/plugin/apps.py b/InvenTree/plugin/apps.py index 436fdc738e..8d43d09354 100644 --- a/InvenTree/plugin/apps.py +++ b/InvenTree/plugin/apps.py @@ -68,7 +68,8 @@ class PluginAppConfig(AppConfig): plug_key = plugin.PLUGIN_SLUG if getattr(plugin, 'PLUGIN_SLUG', None) else plug_name plugin_db_setting, _ = PluginConfig.objects.get_or_create(key=plug_key, name=plug_name) - if plugin_db_setting.active: + # always activate if testing + if settings.TESTING or plugin_db_setting.active: # init package # now we can be sure that an admin has activated the plugin -> as of Nov 2021 there are not many checks in place # but we could enhance those to check signatures, run the plugin against a whitelist etc.