test _str

This commit is contained in:
Matthias 2022-05-06 01:12:22 +02:00
parent 1a70829f5c
commit 7f8d20da0f
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -10,6 +10,7 @@ from django.urls import reverse
from InvenTree.api_tester import InvenTreeAPITestCase
from InvenTree.helpers import str2bool
from plugin.models import NotificationUserSetting
from .models import InvenTreeSetting, InvenTreeUserSetting, WebhookEndpoint, WebhookMessage, NotificationEntry
from .api import WebhookView
@ -386,6 +387,11 @@ class NotificationUserSettingsApiTest(InvenTreeAPITestCase):
self.get(url, expected_code=200)
def test_setting(self):
"""Test the string name for NotificationUserSetting"""
test_setting = NotificationUserSetting.get_setting_object('NOTIFICATION_METHOD_MAIL', user=self.user)
self.assertEqual(str(test_setting), 'NOTIFICATION_METHOD_MAIL (for testuser): ')
class WebhookMessageTests(TestCase):
def setUp(self):