mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	added test for wrong config
This commit is contained in:
		@@ -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 """
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user