mirror of
https://github.com/ansible/awx.git
synced 2026-02-24 22:46:01 -03:30
change unit tests to work with JobTemplateMixin serializer
This commit is contained in:
@@ -11,6 +11,7 @@ from awx.main.models import (
|
|||||||
Role,
|
Role,
|
||||||
User,
|
User,
|
||||||
Job,
|
Job,
|
||||||
|
JobTemplate,
|
||||||
)
|
)
|
||||||
from rest_framework.test import APIRequestFactory
|
from rest_framework.test import APIRequestFactory
|
||||||
|
|
||||||
@@ -24,7 +25,9 @@ def mock_JT_resource_data():
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def job_template(mocker):
|
def job_template(mocker):
|
||||||
mock_jt = mocker.MagicMock(pk=5)
|
mock_jt = mocker.MagicMock(spec=JobTemplate)
|
||||||
|
mock_jt.pk = 5
|
||||||
|
mock_jt.host_config_key = '9283920492'
|
||||||
mock_jt.resource_validation_data = mock_JT_resource_data
|
mock_jt.resource_validation_data = mock_JT_resource_data
|
||||||
return mock_jt
|
return mock_jt
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user