mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-13 00:08:36 -05:00
Moved a couple of test cases from old/projects.py tests to new test_projects.py tests
This commit is contained in:
@@ -32,6 +32,7 @@ from awx.main.models.inventory import (
|
||||
from awx.main.models.organization import (
|
||||
Organization,
|
||||
Permission,
|
||||
Team,
|
||||
)
|
||||
|
||||
from awx.main.models.rbac import Role
|
||||
@@ -102,6 +103,33 @@ def project(instance, organization):
|
||||
)
|
||||
return prj
|
||||
|
||||
@pytest.fixture
|
||||
def project_factory(organization):
|
||||
def factory(name):
|
||||
try:
|
||||
prj = Project.objects.get(name=name)
|
||||
except Project.DoesNotExist:
|
||||
prj = Project.objects.create(name=name,
|
||||
description="description for " + name,
|
||||
scm_type="git",
|
||||
scm_url="https://github.com/jlaska/ansible-playbooks",
|
||||
organization=organization
|
||||
)
|
||||
return prj
|
||||
return factory
|
||||
|
||||
@pytest.fixture
|
||||
def team_factory(organization):
|
||||
def factory(name):
|
||||
try:
|
||||
t = Team.objects.get(name=name)
|
||||
except Team.DoesNotExist:
|
||||
t = Team.objects.create(name=name,
|
||||
description="description for " + name,
|
||||
organization=organization)
|
||||
return t
|
||||
return factory
|
||||
|
||||
@pytest.fixture
|
||||
def user_project(user):
|
||||
owner = user('owner')
|
||||
|
||||
Reference in New Issue
Block a user