From d2fc514ba754ab09cd36686f9de651015c73ad5f Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sat, 4 Apr 2026 16:21:56 +0200 Subject: [PATCH] move test --- src/backend/InvenTree/plugin/test_api.py | 38 +++++++++++++++--------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/backend/InvenTree/plugin/test_api.py b/src/backend/InvenTree/plugin/test_api.py index 41b686f66e..82dbc824f1 100644 --- a/src/backend/InvenTree/plugin/test_api.py +++ b/src/backend/InvenTree/plugin/test_api.py @@ -111,20 +111,6 @@ 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, @@ -691,3 +677,27 @@ class PluginFullAPITest(PluginMixin, InvenTreeAPITestCase): # Successful uninstallation with self.assertRaises(PluginConfig.DoesNotExist): PluginConfig.objects.get(key=slug) + + def test_registry(self): + """Test install with a custom registry.""" + # install - python repository url and package name + data = self.post( + reverse('api-plugin-install'), + { + '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') + + # and uninstall it again to clean up + response = self.patch( + reverse('api-plugin-uninstall', kwargs={'plugin': 'inventree-approval'}), + data={'delete_config': True}, + max_query_count=350, + ) + self.assertEqual(response.status_code, 200)