Add test for wrong key

This commit is contained in:
Matthias 2022-05-15 01:07:35 +02:00
parent 48d458698a
commit 38cb557baf
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -503,6 +503,11 @@ class PluginSettingsApiTest(InvenTreeAPITestCase):
response = self.get(url, expected_code=404)
self.assertIn("Plugin 'doesnotexist' not installed", str(response.data))
# Wrong key
url = reverse('api-plugin-setting-detail', kwargs={'plugin': 'sample', 'key': 'doesnotexsist'})
response = self.get(url, expected_code=404)
self.assertIn("Plugin 'sample' has no setting matching 'doesnotexsist'", str(response.data))
def test_invalid_setting_key(self):
"""Test that an invalid setting key returns a 404"""
...