diff --git a/awx/main/tests/data/inventory/plugins/insights/env.json b/awx/main/tests/data/inventory/plugins/insights/env.json index b87328e76187..bbece6a48fcf 100644 --- a/awx/main/tests/data/inventory/plugins/insights/env.json +++ b/awx/main/tests/data/inventory/plugins/insights/env.json @@ -1,4 +1,6 @@ { "INSIGHTS_USER": "fooo", - "INSIGHTS_PASSWORD": "fooo" + "INSIGHTS_PASSWORD": "fooo", + "INSIGHTS_CLIENT_ID": "fooo", + "INSIGHTS_CLIENT_SECRET": "fooo" } diff --git a/awx/main/tests/functional/rbac/test_rbac_migration.py b/awx/main/tests/functional/rbac/test_rbac_migration.py deleted file mode 100644 index 8ee411ba1a5a..000000000000 --- a/awx/main/tests/functional/rbac/test_rbac_migration.py +++ /dev/null @@ -1,49 +0,0 @@ -import pytest - -from awx.main.migrations import _rbac as rbac -from awx.main.models import UnifiedJobTemplate, InventorySource, Inventory, JobTemplate, Project, Organization - - -@pytest.mark.django_db -def test_implied_organization_subquery_inventory(): - orgs = [] - for i in range(3): - orgs.append(Organization.objects.create(name='foo{}'.format(i))) - orgs.append(orgs[0]) - for i in range(4): - org = orgs[i] - if i == 2: - inventory = Inventory.objects.create(name='foo{}'.format(i)) - else: - inventory = Inventory.objects.create(name='foo{}'.format(i), organization=org) - inv_src = InventorySource.objects.create(name='foo{}'.format(i), inventory=inventory, source='ec2') - sources = UnifiedJobTemplate.objects.annotate(test_field=rbac.implicit_org_subquery(UnifiedJobTemplate, InventorySource)) - for inv_src in sources: - assert inv_src.test_field == inv_src.inventory.organization_id - - -@pytest.mark.django_db -def test_implied_organization_subquery_job_template(): - jts = [] - for i in range(5): - if i <= 3: - org = Organization.objects.create(name='foo{}'.format(i)) - else: - org = None - if i <= 4: - proj = Project.objects.create(name='foo{}'.format(i), organization=org) - else: - proj = None - jts.append(JobTemplate.objects.create(name='foo{}'.format(i), project=proj)) - # test case of sharing same org - jts[2].project.organization = jts[3].project.organization - jts[2].save() - ujts = UnifiedJobTemplate.objects.annotate(test_field=rbac.implicit_org_subquery(UnifiedJobTemplate, JobTemplate)) - for jt in ujts: - if not isinstance(jt, JobTemplate): # some are projects - assert jt.test_field is None - else: - if jt.project is None: - assert jt.test_field is None - else: - assert jt.test_field == jt.project.organization_id