diff --git a/InvenTree/InvenTree/apps.py b/InvenTree/InvenTree/apps.py index 18df00030a..6b2f2b1610 100644 --- a/InvenTree/InvenTree/apps.py +++ b/InvenTree/InvenTree/apps.py @@ -180,7 +180,7 @@ class InvenTreeConfig(AppConfig): # not all needed variables set if set_variables < 3: - logger.warn('Not all required settings for adding a user on startup are present:\nINVENTREE_SET_USER, INVENTREE_SET_EMAIL, INVENTREE_SET_PASSWORD') + logger.warn('Not all required settings for adding a user on startup are present:\nINVENTREE_ADMIN_USER, INVENTREE_ADMIN_EMAIL, INVENTREE_ADMIN_PASSWORD') settings.USER_ADDED = True return diff --git a/InvenTree/plugin/helpers.py b/InvenTree/plugin/helpers.py index 1a5089aefe..7f9f2be740 100644 --- a/InvenTree/plugin/helpers.py +++ b/InvenTree/plugin/helpers.py @@ -11,6 +11,7 @@ import pkgutil from django.conf import settings from django.core.exceptions import AppRegistryNotReady +from django.db.utils import IntegrityError # region logging / errors @@ -85,6 +86,9 @@ def handle_error(error, do_raise: bool = True, do_log: bool = True, log_name: st log_error({package_name: str(error)}, **log_kwargs) if do_raise: + # do a straight raise if we are playing with enviroment variables at execution time, ignore the broken sample + if settings.TESTING_ENV and package_name != 'integration.broken_sample' and isinstance(error, IntegrityError): + raise error raise IntegrationPluginError(package_name, str(error)) # endregion diff --git a/InvenTree/plugin/test_api.py b/InvenTree/plugin/test_api.py index faa3fb39c4..f04457f3f8 100644 --- a/InvenTree/plugin/test_api.py +++ b/InvenTree/plugin/test_api.py @@ -77,9 +77,11 @@ class PluginDetailAPITest(InvenTreeAPITestCase): fixtures = PluginConfig.objects.all() # check if plugins were registered -> in some test setups the startup has no db access + print(f'[PLUGIN-TEST] currently {len(fixtures)} plugin entries found') if not fixtures: registry.reload_plugins() fixtures = PluginConfig.objects.all() + print(f'Reloaded plugins - now {len(fixtures)} entries found') print([str(a) for a in fixtures]) fixtures = fixtures[0:1]