mirror of
https://github.com/ansible/awx.git
synced 2026-01-28 00:51:27 -03:30
...*before* running the associated job template. Set "wait" default to True so CI doesn't time out Change default back to "False", put in new "if"... ...block, explicitly set "wait" to "False" in test file. Change if block Update README Update 'wait' option description
30 lines
756 B
Python
30 lines
756 B
Python
from __future__ import (absolute_import, division, print_function)
|
|
__metaclass__ = type
|
|
|
|
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',
|
|
wait=False
|
|
), 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'
|
|
}
|