activate plugins if testing

This commit is contained in:
Matthias 2021-11-13 01:15:20 +01:00
parent 6015de1cd9
commit 5272b56d04
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -68,7 +68,8 @@ class PluginAppConfig(AppConfig):
plug_key = plugin.PLUGIN_SLUG if getattr(plugin, 'PLUGIN_SLUG', None) else plug_name 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) 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 # 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 # 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. # but we could enhance those to check signatures, run the plugin against a whitelist etc.