From 6df41d11e369e08ab63965171001720434333042 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Fri, 17 Jul 2026 14:48:54 +0200 Subject: [PATCH] fix failing test --- awx/main/tests/functional/tasks/test_tasks_system.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/main/tests/functional/tasks/test_tasks_system.py b/awx/main/tests/functional/tasks/test_tasks_system.py index 2b9c6ad084..ff2e5a345e 100644 --- a/awx/main/tests/functional/tasks/test_tasks_system.py +++ b/awx/main/tests/functional/tasks/test_tasks_system.py @@ -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