From 4397f57acc910100b3b84c423f4e0e2bfdef72c3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 11 May 2022 23:11:54 +0200 Subject: [PATCH] test that a save() action on a plugin is reloading --- InvenTree/plugin/test_api.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/InvenTree/plugin/test_api.py b/InvenTree/plugin/test_api.py index 31fe61b469..c767f0f8c0 100644 --- a/InvenTree/plugin/test_api.py +++ b/InvenTree/plugin/test_api.py @@ -139,7 +139,15 @@ class PluginDetailAPITest(InvenTreeAPITestCase): registry.reload_plugins() fixtures = PluginConfig.objects.all() + # check mixin registry plg = fixtures.first() mixin_dict = plg.mixins() self.assertIn('base', mixin_dict) self.assertDictContainsSubset({'base':{'key':'base', 'human_name':'base'}}, mixin_dict) + + # check reload on save + with self.assertWarns('A reload was triggered'): + plg_inactive = fixtures.filter(active=False).first() + plg_inactive.active = True + plg_inactive.save() + print('done')