mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
parent
701b1e2145
commit
9f5526f489
@ -1,14 +1,13 @@
|
||||
"""Utility file to enable simper imports."""
|
||||
|
||||
from .helpers import MixinImplementationError, MixinNotImplementedError
|
||||
from .plugin import IntegrationPluginBase, InvenTreePlugin
|
||||
from .plugin import InvenTreePlugin
|
||||
from .registry import registry
|
||||
|
||||
__all__ = [
|
||||
'registry',
|
||||
|
||||
'InvenTreePlugin',
|
||||
'IntegrationPluginBase',
|
||||
'MixinNotImplementedError',
|
||||
'MixinImplementationError',
|
||||
]
|
||||
|
@ -298,16 +298,3 @@ class InvenTreePlugin(MixinBase, MetaBase):
|
||||
self.package = package
|
||||
self.sign_state = sign_state
|
||||
# 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
|
||||
|
||||
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,
|
||||
WrongIntegrationPlugin)
|
||||
from plugin.samples.integration.sample import SampleIntegrationPlugin
|
||||
@ -162,11 +162,3 @@ class InvenTreePluginTests(TestCase):
|
||||
self.assertEqual(self.plugin_old.slug, 'old')
|
||||
# check default value is used
|
||||
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…
Reference in New Issue
Block a user