fix failing test

This commit is contained in:
Peter Braun
2026-07-17 14:48:54 +02:00
parent 1603d4513a
commit 6df41d11e3

View File

@@ -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