starting unittests for plugins

This commit is contained in:
Matthias 2021-09-25 00:55:22 +02:00
parent 70edb330ea
commit 5a2c2b96ec
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -0,0 +1,24 @@
""" Unit tests for plugins """
from django.test import TestCase
import plugins.plugin
class InvenTreePluginTests(TestCase):
""" Tests for InvenTreePlugin """
def setUp(self):
self.plugin = plugins.plugin.InvenTreePlugin()
class NamedPlugin(plugins.plugin.InvenTreePlugin):
PLUGIN_NAME = 'abc123'
self.named_plugin = NamedPlugin()
def test_basic_plugin_init(self):
self.assertEqual(self.plugin.PLUGIN_NAME, '')
self.assertEqual(self.plugin.plugin_name(), '')
def test_basic_plugin_name(self):
self.assertEqual(self.named_plugin.PLUGIN_NAME, 'abc123')
self.assertEqual(self.named_plugin.plugin_name(), 'abc123')