From c8599039a25cb17535f41149d588ff3acb4836af Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 9 Jan 2022 22:33:14 +0100 Subject: [PATCH] added test for wrong config --- InvenTree/plugin/test_integration.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/InvenTree/plugin/test_integration.py b/InvenTree/plugin/test_integration.py index eb55f984d3..48533a70e2 100644 --- a/InvenTree/plugin/test_integration.py +++ b/InvenTree/plugin/test_integration.py @@ -171,6 +171,11 @@ class APICallMixinTest(BaseMixinDefinition, TestCase): ''' return self.api_call('api/users/2') self.mixin = MixinCls() + + class WrongCLS(APICallMixin, IntegrationPluginBase): + pass + self.mixin_nothing = WrongCLS() + def test_function(self): # api_url self.assertEqual('https://reqres.in', self.mixin.api_url) @@ -185,6 +190,10 @@ class APICallMixinTest(BaseMixinDefinition, TestCase): self.assertTrue(result) self.assertIn('data', result,) + # wrongly defined plugins should not load + with self.assertRaises(ValueError): + self.mixin_nothing.has_api_call() + class IntegrationPluginBaseTests(TestCase): """ Tests for IntegrationPluginBase """