Initial removal of InventorySource.group

This commit is contained in:
Wayne Witzel III
2017-04-06 13:57:16 -04:00
parent 9747674cb3
commit c784c96449
8 changed files with 36 additions and 94 deletions

View File

@@ -343,7 +343,8 @@ def group(inventory):
@pytest.fixture
def inventory_source(group, inventory):
return InventorySource.objects.create(name=group.name, group=group,
group.inventory = inventory
return InventorySource.objects.create(name=group.name,
inventory=inventory, source='gce')

View File

@@ -3,7 +3,7 @@ import pytest
from awx.api.versioning import reverse
from awx.main.models.notifications import NotificationTemplate, Notification
from awx.main.models.inventory import Inventory, Group
from awx.main.models.inventory import Inventory, InventorySource
from awx.main.models.jobs import JobTemplate
@@ -84,8 +84,8 @@ def test_inherited_notification_templates(get, post, user, organization, project
notification_templates.append(response.data['id'])
i = Inventory.objects.create(name='test', organization=organization)
i.save()
g = Group.objects.create(name='test', inventory=i)
g.save()
isrc = InventorySource.objects.create(name='test', inventory=i)
isrc.save()
jt = JobTemplate.objects.create(name='test', inventory=i, project=project, playbook='debug.yml')
jt.save()
url = reverse('api:organization_notification_templates_any_list', kwargs={'pk': organization.id})
@@ -99,7 +99,7 @@ def test_inherited_notification_templates(get, post, user, organization, project
assert response.status_code == 204
assert len(jt.notification_templates['any']) == 3
assert len(project.notification_templates['any']) == 2
assert len(g.inventory_source.notification_templates['any']) == 1
assert len(isrc.notification_templates['any']) == 1
@pytest.mark.django_db