mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 19:50:59 +00:00
Plugin API refactor (#3637)
* out-of-scope: refactor plugin lookup * lookup by settings (runtime not predefined) * Add registry function to set state of plugin quickly * Ensure plugin is active before assertations
This commit is contained in:
@ -11,6 +11,7 @@ from django.urls import reverse
|
||||
|
||||
from InvenTree.api_tester import InvenTreeAPITestCase, PluginMixin
|
||||
from InvenTree.helpers import InvenTreeTestCase, str2bool
|
||||
from plugin import registry
|
||||
from plugin.models import NotificationUserSetting
|
||||
|
||||
from .api import WebhookView
|
||||
@ -560,6 +561,9 @@ class PluginSettingsApiTest(PluginMixin, InvenTreeAPITestCase):
|
||||
|
||||
def test_valid_plugin_slug(self):
|
||||
"""Test that an valid plugin slug runs through."""
|
||||
# Activate plugin
|
||||
registry.set_plugin_state('sample', True)
|
||||
|
||||
# get data
|
||||
url = reverse('api-plugin-setting-detail', kwargs={'plugin': 'sample', 'key': 'API_KEY'})
|
||||
response = self.get(url, expected_code=200)
|
||||
|
Reference in New Issue
Block a user