From 5a2c2b96ec2ad034531e1517c10f501301f457ca Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 25 Sep 2021 00:55:22 +0200 Subject: [PATCH] starting unittests for plugins --- InvenTree/plugins/test_plugin.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 InvenTree/plugins/test_plugin.py diff --git a/InvenTree/plugins/test_plugin.py b/InvenTree/plugins/test_plugin.py new file mode 100644 index 0000000000..ce03ab686e --- /dev/null +++ b/InvenTree/plugins/test_plugin.py @@ -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') +