mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
updated fixtures to use proper organization linking
This commit is contained in:
parent
484ef1b6a8
commit
5da13683ce
@ -146,14 +146,14 @@ const getAdminMachineCredential = (namespace = session) => {
|
||||
};
|
||||
|
||||
const getTeam = (namespace = session) => getOrganization(namespace)
|
||||
.then(organization => getOrCreate('/teams/', {
|
||||
.then(organization => getOrCreate(`/organizations/${organization.id}/teams/`, {
|
||||
name: `${namespace}-team`,
|
||||
description: namespace,
|
||||
organization: organization.id,
|
||||
}));
|
||||
|
||||
const getSmartInventory = (namespace = session) => getOrganization(namespace)
|
||||
.then(organization => getOrCreate('/inventories/', {
|
||||
.then(organization => getOrCreate(`/inventories/`, {
|
||||
name: `${namespace}-smart-inventory`,
|
||||
description: namespace,
|
||||
organization: organization.id,
|
||||
@ -162,7 +162,7 @@ const getSmartInventory = (namespace = session) => getOrganization(namespace)
|
||||
}));
|
||||
|
||||
const getNotificationTemplate = (namespace = session) => getOrganization(namespace)
|
||||
.then(organization => getOrCreate('/notification_templates/', {
|
||||
.then(organization => getOrCreate(`/organizations/${organization.id}/notification_templates/`, {
|
||||
name: `${namespace}-notification-template`,
|
||||
description: namespace,
|
||||
organization: organization.id,
|
||||
@ -174,7 +174,7 @@ const getNotificationTemplate = (namespace = session) => getOrganization(namespa
|
||||
}));
|
||||
|
||||
const getProject = (namespace = session) => getOrganization(namespace)
|
||||
.then(organization => getOrCreate('/projects/', {
|
||||
.then(organization => getOrCreate(`/organizations/${organization.id}/projects/`, {
|
||||
name: `${namespace}-project`,
|
||||
description: namespace,
|
||||
organization: organization.id,
|
||||
@ -246,10 +246,9 @@ const getJobTemplate = (namespace = session) => {
|
||||
};
|
||||
|
||||
const getWorkflowTemplate = (namespace = session) => {
|
||||
const endpoint = '/workflow_job_templates/';
|
||||
|
||||
const workflowTemplatePromise = getOrganization(namespace)
|
||||
.then(organization => getOrCreate(endpoint, {
|
||||
.then(organization => getOrCreate(`/organizations/${organization.id}/workflow_job_templates/`, {
|
||||
name: `${namespace}-workflow-template`,
|
||||
organization: organization.id,
|
||||
variables: '---',
|
||||
@ -288,7 +287,7 @@ const getWorkflowTemplate = (namespace = session) => {
|
||||
};
|
||||
|
||||
const getAuditor = (namespace = session) => getOrganization(namespace)
|
||||
.then(organization => getOrCreate('/users/', {
|
||||
.then(organization => getOrCreate(`/organizations/${organization.id}/users/`, {
|
||||
username: `auditor-${uuid().substr(0, 8)}`,
|
||||
organization: organization.id,
|
||||
first_name: 'auditor',
|
||||
@ -300,7 +299,7 @@ const getAuditor = (namespace = session) => getOrganization(namespace)
|
||||
}, ['username']));
|
||||
|
||||
const getUser = (namespace = session) => getOrganization(namespace)
|
||||
.then(organization => getOrCreate('/users/', {
|
||||
.then(organization => getOrCreate(`/organizations/${organization.id}/users/`, {
|
||||
username: `user-${uuid().substr(0, 8)}`,
|
||||
organization: organization.id,
|
||||
first_name: 'firstname',
|
||||
@ -316,7 +315,7 @@ const getJobTemplateAdmin = (namespace = session) => {
|
||||
.then(obj => obj.summary_fields.object_roles.admin_role);
|
||||
|
||||
const userPromise = getOrganization(namespace)
|
||||
.then(obj => getOrCreate('/users/', {
|
||||
.then(obj => getOrCreate(`/organizations/${obj.id}/users/`, {
|
||||
username: `job-template-admin-${uuid().substr(0, 8)}`,
|
||||
organization: obj.id,
|
||||
first_name: 'firstname',
|
||||
@ -339,7 +338,7 @@ const getProjectAdmin = (namespace = session) => {
|
||||
.then(obj => obj.summary_fields.object_roles.admin_role);
|
||||
|
||||
const userPromise = getOrganization(namespace)
|
||||
.then(obj => getOrCreate('/users/', {
|
||||
.then(obj => getOrCreate(`/organizations/${obj.id}/users/`, {
|
||||
username: `project-admin-${uuid().substr(0, 8)}`,
|
||||
organization: obj.id,
|
||||
first_name: 'firstname',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user