test plugin model more

This commit is contained in:
Matthias 2022-05-11 23:05:08 +02:00
parent da885456b7
commit 8a91fc362b
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -124,3 +124,22 @@ class PluginDetailAPITest(InvenTreeAPITestCase):
'_save': 'Save',
}, follow=True)
self.assertEqual(response.status_code, 200)
def test_model(self):
"""
Test the PluginConfig model
"""
from plugin.models import PluginConfig
from plugin import registry
fixtures = PluginConfig.objects.all()
# check if plugins were registered
if not fixtures:
registry.reload_plugins()
fixtures = PluginConfig.objects.all()
plg = fixtures.first()
mixin_dict = plg.mixins()
self.assertIn('base', mixin_dict)
self.assertDictContainsSubset({'base':{'key':'base', 'human_name':'base'}}, mixin_dict)