mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
added test for wrong config
This commit is contained in:
parent
e889f487f0
commit
c8599039a2
@ -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 """
|
||||
|
Loading…
Reference in New Issue
Block a user