From 8ea9382e715b34f21d507c564745bd58185ba8e6 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sat, 4 Apr 2026 15:43:48 +0200 Subject: [PATCH] add more tests --- src/backend/InvenTree/plugin/test_api.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/backend/InvenTree/plugin/test_api.py b/src/backend/InvenTree/plugin/test_api.py index ca6c312670..4b76d737f2 100644 --- a/src/backend/InvenTree/plugin/test_api.py +++ b/src/backend/InvenTree/plugin/test_api.py @@ -111,6 +111,29 @@ class PluginDetailAPITest(PluginMixin, InvenTreeAPITestCase): ).data self.assertEqual(data['success'], 'Installed plugin successfully') + # valid - python repository url and package name + data = self.post( + url, + { + 'confirm': True, + 'url': 'https://git.invenhost.com/api/packages/invenhost-c1/pypi/simple/', + 'packagename': 'inventree-approval', + }, + expected_code=201, + max_query_count=450, + max_query_time=30, + ).data + self.assertEqual(data['success'], 'Installed plugin successfully') + + # valid (kindoff) - Pypi and onsense uri + data = self.post( + url, + {'confirm': True, 'packagename': self.PKG_NAME, 'url': 'lol://example.com'}, + expected_code=201, + max_query_time=30, + max_query_count=450, + ).data + # invalid tries # no input data = self.post(url, {}, expected_code=400).data