mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 19:50:05 -03:30
move factory fixture
* Move factory fixture back one directory so unit tests can now take advantage of them; while still allowing functional tests to use them
This commit is contained in:
27
awx/main/tests/conftest.py
Normal file
27
awx/main/tests/conftest.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
# Python
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from awx.main.tests.factories import (
|
||||||
|
create_organization,
|
||||||
|
create_job_template,
|
||||||
|
create_notification_template,
|
||||||
|
create_survey_spec,
|
||||||
|
)
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def job_template_factory():
|
||||||
|
return create_job_template
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def organization_factory():
|
||||||
|
return create_organization
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def notification_template_factory():
|
||||||
|
return create_notification_template
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def survey_spec_factory():
|
||||||
|
return create_survey_spec
|
||||||
|
|
||||||
@@ -38,13 +38,6 @@ from awx.main.models.organization import (
|
|||||||
|
|
||||||
from awx.main.models.notifications import NotificationTemplate
|
from awx.main.models.notifications import NotificationTemplate
|
||||||
|
|
||||||
from awx.main.tests.factories import (
|
|
||||||
create_organization,
|
|
||||||
create_job_template,
|
|
||||||
create_notification_template,
|
|
||||||
create_survey_spec,
|
|
||||||
)
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Disable all django model signals.
|
Disable all django model signals.
|
||||||
'''
|
'''
|
||||||
@@ -490,19 +483,3 @@ def job_template_labels(organization, job_template):
|
|||||||
|
|
||||||
return job_template
|
return job_template
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def job_template_factory():
|
|
||||||
return create_job_template
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def organization_factory():
|
|
||||||
return create_organization
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def notification_template_factory():
|
|
||||||
return create_notification_template
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def survey_spec_factory():
|
|
||||||
return create_survey_spec
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user