mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 03:56:43 +00:00
parent
701b1e2145
commit
9f5526f489
@ -1,14 +1,13 @@
|
|||||||
"""Utility file to enable simper imports."""
|
"""Utility file to enable simper imports."""
|
||||||
|
|
||||||
from .helpers import MixinImplementationError, MixinNotImplementedError
|
from .helpers import MixinImplementationError, MixinNotImplementedError
|
||||||
from .plugin import IntegrationPluginBase, InvenTreePlugin
|
from .plugin import InvenTreePlugin
|
||||||
from .registry import registry
|
from .registry import registry
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'registry',
|
'registry',
|
||||||
|
|
||||||
'InvenTreePlugin',
|
'InvenTreePlugin',
|
||||||
'IntegrationPluginBase',
|
|
||||||
'MixinNotImplementedError',
|
'MixinNotImplementedError',
|
||||||
'MixinImplementationError',
|
'MixinImplementationError',
|
||||||
]
|
]
|
||||||
|
@ -298,16 +298,3 @@ class InvenTreePlugin(MixinBase, MetaBase):
|
|||||||
self.package = package
|
self.package = package
|
||||||
self.sign_state = sign_state
|
self.sign_state = sign_state
|
||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
|
|
||||||
class IntegrationPluginBase(InvenTreePlugin):
|
|
||||||
"""Legacy base class for plugins.
|
|
||||||
|
|
||||||
Do not use!
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
"""Send warning about using this reference."""
|
|
||||||
# TODO remove in 0.8.0
|
|
||||||
warnings.warn("This import is deprecated - use InvenTreePlugin", DeprecationWarning)
|
|
||||||
super().__init__(*args, **kwargs)
|
|
||||||
|
@ -5,7 +5,7 @@ from datetime import datetime
|
|||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
import plugin.templatetags.plugin_extras as plugin_tags
|
import plugin.templatetags.plugin_extras as plugin_tags
|
||||||
from plugin import IntegrationPluginBase, InvenTreePlugin, registry
|
from plugin import InvenTreePlugin, registry
|
||||||
from plugin.samples.integration.another_sample import (NoIntegrationPlugin,
|
from plugin.samples.integration.another_sample import (NoIntegrationPlugin,
|
||||||
WrongIntegrationPlugin)
|
WrongIntegrationPlugin)
|
||||||
from plugin.samples.integration.sample import SampleIntegrationPlugin
|
from plugin.samples.integration.sample import SampleIntegrationPlugin
|
||||||
@ -162,11 +162,3 @@ class InvenTreePluginTests(TestCase):
|
|||||||
self.assertEqual(self.plugin_old.slug, 'old')
|
self.assertEqual(self.plugin_old.slug, 'old')
|
||||||
# check default value is used
|
# check default value is used
|
||||||
self.assertEqual(self.plugin_old.get_meta_value('ABC', 'ABCD', '123'), '123')
|
self.assertEqual(self.plugin_old.get_meta_value('ABC', 'ABCD', '123'), '123')
|
||||||
|
|
||||||
# check usage of the old class fires
|
|
||||||
class OldPlugin(IntegrationPluginBase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
with self.assertWarns(DeprecationWarning):
|
|
||||||
plg = OldPlugin()
|
|
||||||
self.assertIsInstance(plg, InvenTreePlugin)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user