From b6e8f6d40452cb4b962e58d6c0a0e8c6f3c7f35a Mon Sep 17 00:00:00 2001 From: Ammar Ammar <43293485+ammar257ammar@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:29:28 +0000 Subject: [PATCH] Test user upload delete in add_file_to_object func --- app/tests/components_tests/test_tasks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/tests/components_tests/test_tasks.py b/app/tests/components_tests/test_tasks.py index 9b65196d77..a202d1de39 100644 --- a/app/tests/components_tests/test_tasks.py +++ b/app/tests/components_tests/test_tasks.py @@ -33,6 +33,7 @@ from grandchallenge.core.celery import _retry, acks_late_micro_short_task from grandchallenge.notifications.models import Notification from grandchallenge.reader_studies.models import InteractiveAlgorithmChoices +from grandchallenge.uploads.models import UserUpload from tests.algorithms_tests.factories import ( AlgorithmFactory, AlgorithmImageFactory, @@ -536,6 +537,7 @@ def test_add_file_to_object( linked_task=linked_task, ) + assert not UserUpload.objects.filter(pk=us.pk).exists() assert ComponentInterfaceValue.objects.filter(interface=ci).count() == 1 assert "some_async_task" in str(callbacks)