mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 18:37:39 -02:30
Compute fields in smart task_impact tests
This commit is contained in:
@@ -122,6 +122,22 @@ def project_playbooks():
|
||||
mocked.start()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def run_computed_fields_right_away(request):
|
||||
|
||||
def run_me(inventory_id, should_update_hosts=True):
|
||||
i = Inventory.objects.get(id=inventory_id)
|
||||
i.update_computed_fields(update_hosts=should_update_hosts)
|
||||
|
||||
mocked = mock.patch(
|
||||
'awx.main.signals.update_inventory_computed_fields.delay',
|
||||
new=run_me
|
||||
)
|
||||
mocked.start()
|
||||
|
||||
request.addfinalizer(mocked.stop)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@mock.patch.object(Project, "update", lambda self, **kwargs: None)
|
||||
def project(instance, organization):
|
||||
|
||||
Reference in New Issue
Block a user