test that a save() action on a plugin is reloading

This commit is contained in:
Matthias 2022-05-11 23:11:54 +02:00
parent baca0dc268
commit 4397f57acc
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -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')