mirror of
https://github.com/ansible/awx.git
synced 2026-07-17 19:31:55 -02:30
fix failing test
This commit is contained in:
@@ -115,10 +115,13 @@ def test_folder_cleanup_multiple_running_jobs(job_folder_factory, me_inst):
|
||||
@pytest.mark.django_db
|
||||
class TestBatchedDeleteInventory:
|
||||
def _make_inventory_with_hosts(self, count):
|
||||
from django.utils import timezone
|
||||
|
||||
now = timezone.now()
|
||||
org = Organization.objects.create(name='test-org')
|
||||
inv = Inventory.objects.create(name='test-inv', organization=org)
|
||||
group = Group.objects.create(name='test-group', inventory=inv)
|
||||
hosts = [Host(name=f'host-{i}', inventory=inv) for i in range(count)]
|
||||
hosts = [Host(name=f'host-{i}', inventory=inv, created=now, modified=now) for i in range(count)]
|
||||
Host.objects.bulk_create(hosts)
|
||||
group.hosts.set(Host.objects.filter(inventory=inv))
|
||||
return inv
|
||||
|
||||
Reference in New Issue
Block a user