move test

This commit is contained in:
Matthias Mair 2026-04-04 16:21:56 +02:00
parent e8ff45b143
commit d2fc514ba7
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
1 changed files with 24 additions and 14 deletions

View File

@ -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)