Update errors

This commit is contained in:
Matthias Mair 2022-05-15 04:47:45 +02:00 committed by GitHub
parent 897dd115f9
commit dcbd9d906b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ from django.contrib.auth import get_user_model
from plugin import InvenTreePlugin
from plugin.mixins import AppMixin, SettingsMixin, UrlsMixin, NavigationMixin, APICallMixin
from plugin.urls import PLUGIN_BASE
from plugin.helpers import MixinNotImplementedError
class BaseMixinDefinition:
@ -237,9 +238,9 @@ class APICallMixinTest(BaseMixinDefinition, TestCase):
def test_function_errors(self):
"""Test function errors"""
# wrongly defined plugins should not load
with self.assertRaises(ValueError):
with self.assertRaises(MixinNotImplementedError):
self.mixin_wrong.has_api_call()
# cover wrong token setting
with self.assertRaises(ValueError):
with self.assertRaises(MixinNotImplementedError):
self.mixin_wrong2.has_api_call()