mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add check for IntegrationPluginBase depreciation
This commit is contained in:
parent
da3b7ae7d0
commit
c809398bda
@ -9,7 +9,7 @@ from django.test import TestCase
|
|||||||
from plugin.samples.integration.sample import SampleIntegrationPlugin
|
from plugin.samples.integration.sample import SampleIntegrationPlugin
|
||||||
from plugin.samples.integration.another_sample import WrongIntegrationPlugin, NoIntegrationPlugin
|
from plugin.samples.integration.another_sample import WrongIntegrationPlugin, NoIntegrationPlugin
|
||||||
import plugin.templatetags.plugin_extras as plugin_tags
|
import plugin.templatetags.plugin_extras as plugin_tags
|
||||||
from plugin import registry, InvenTreePlugin
|
from plugin import registry, InvenTreePlugin, IntegrationPluginBase
|
||||||
|
|
||||||
|
|
||||||
class PluginTagTests(TestCase):
|
class PluginTagTests(TestCase):
|
||||||
@ -162,3 +162,11 @@ class InvenTreePluginTests(TestCase):
|
|||||||
self.assertEqual(self.plugin_old.name, 'OldPlugin')
|
self.assertEqual(self.plugin_old.name, 'OldPlugin')
|
||||||
# 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…
Reference in New Issue
Block a user