remove ability to add constructed inventories to constructed inventories

This commit is contained in:
Gabe Muniz
2023-02-10 12:46:11 -05:00
parent c98f86a355
commit 2d9f2d36a1
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import pytest
from awx.main.models import Inventory
from awx.api.versioning import reverse
@pytest.mark.django_db
def test_constructed_inventory_post(post, organization, admin_user):
inventory1 = Inventory.objects.create(name='dummy1', kind='constructed', organization=organization)
inventory2 = Inventory.objects.create(name='dummy2', kind='constructed', organization=organization)
resp = post(
url=reverse('api:inventory_input_inventories', kwargs={'pk': inventory1.id}),
data={'id': inventory2.id},
user=admin_user,
expect=405,
)
print(resp)
assert resp.status_code == 405