mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 17:48:10 -03:30
Ability to list teams attached to a project.
This commit is contained in:
@@ -63,9 +63,14 @@ class BaseTestMixin(object):
|
||||
|
||||
def make_projects(self, created_by, count=1, playbook_content=''):
|
||||
results = []
|
||||
|
||||
if not os.path.exists(settings.PROJECTS_ROOT):
|
||||
os.makedirs(settings.PROJECTS_ROOT)
|
||||
|
||||
for x in range(0, count):
|
||||
self.object_ctr = self.object_ctr + 1
|
||||
# Create temp project directory.
|
||||
|
||||
project_dir = tempfile.mkdtemp(dir=settings.PROJECTS_ROOT)
|
||||
self._temp_project_dirs.append(project_dir)
|
||||
# Create temp playbook in project (if playbook content is given).
|
||||
|
||||
@@ -212,6 +212,24 @@ class ProjectsTest(BaseTest):
|
||||
deleted = self.post(org_teams, data2, expect=204, auth=self.get_normal_credentials())
|
||||
got = self.get(url, expect=404, auth=self.get_normal_credentials())
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# TEAM PROJECTS
|
||||
|
||||
team = Team.objects.filter(organization__pk = 2)[0]
|
||||
team_projects = '/api/v1/teams/%s/projects/' % (team.pk)
|
||||
|
||||
p1 = self.projects[0]
|
||||
team.projects.add(p1)
|
||||
team.save()
|
||||
|
||||
got = self.get(team_projects, expect=200, auth=self.get_super_credentials())
|
||||
|
||||
# FIXME: project postablility tests somewhat incomplete.
|
||||
# add tests to show we can create new projects on the subresource and so on.
|
||||
|
||||
self.assertEquals(got['count'], 1)
|
||||
|
||||
# =====================================================================
|
||||
# TEAMS USER MEMBERSHIP
|
||||
|
||||
|
||||
Reference in New Issue
Block a user