mirror of
https://github.com/ansible/awx.git
synced 2026-08-05 20:40:01 -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
|
@pytest.mark.django_db
|
||||||
class TestBatchedDeleteInventory:
|
class TestBatchedDeleteInventory:
|
||||||
def _make_inventory_with_hosts(self, count):
|
def _make_inventory_with_hosts(self, count):
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
|
now = timezone.now()
|
||||||
org = Organization.objects.create(name='test-org')
|
org = Organization.objects.create(name='test-org')
|
||||||
inv = Inventory.objects.create(name='test-inv', organization=org)
|
inv = Inventory.objects.create(name='test-inv', organization=org)
|
||||||
group = Group.objects.create(name='test-group', inventory=inv)
|
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)
|
Host.objects.bulk_create(hosts)
|
||||||
group.hosts.set(Host.objects.filter(inventory=inv))
|
group.hosts.set(Host.objects.filter(inventory=inv))
|
||||||
return inv
|
return inv
|
||||||
|
|||||||
Reference in New Issue
Block a user