Merge pull request #5176 from AlanCoding/collection_project_create

Fix and test for warning when creating project

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-10-31 16:50:59 +00:00 committed by GitHub
commit 6982a8aee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -145,7 +145,7 @@ def main():
scm_clean=dict(type='bool', default=False),
scm_delete_on_update=dict(type='bool', default=False),
scm_update_on_launch=dict(type='bool', default=False),
scm_update_cache_timeout=dict(type='int', default=0),
scm_update_cache_timeout=dict(type='int'),
job_timeout=dict(type='int', default=0),
custom_virtualenv=dict(),
local_path=dict(),

View File

@ -0,0 +1,25 @@
import pytest
from awx.main.models import Project
@pytest.mark.django_db
def test_create_project(run_module, admin_user, organization):
result = run_module('tower_project', dict(
name='foo',
organization=organization.name,
scm_type='git',
scm_url='https://foo.invalid'
), admin_user)
assert result.pop('changed', None), result
proj = Project.objects.get(name='foo')
assert proj.scm_url == 'https://foo.invalid'
assert proj.organization == organization
result.pop('invocation')
assert result == {
'id': proj.id,
'project': 'foo',
'state': 'present'
}