mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Addig tests and updating minor module bugs
This commit is contained in:
28
awx_collection/test/awx/test_application.py
Normal file
28
awx_collection/test/awx/test_application.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import pytest
|
||||
|
||||
from awx.main.models import Organization, Application
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_create_application(run_module, admin_user):
|
||||
org = Organization.objects.create(name='foo')
|
||||
|
||||
module_args = {
|
||||
'name': 'foo_app',
|
||||
'description': 'barfoo',
|
||||
'state': 'present',
|
||||
'authorization_grant_type': 'password',
|
||||
'client_type': 'public',
|
||||
'organization': 'foo',
|
||||
}
|
||||
|
||||
result = run_module('tower_application', module_args, admin_user)
|
||||
assert result.get('changed'), result
|
||||
|
||||
application = Application.objects.get(name='foo_app')
|
||||
assert application.description == 'barfoo'
|
||||
assert application.organization_id == org.id
|
||||
|
||||
Reference in New Issue
Block a user