Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{% if not civ.image %}
{% include "components/partials/civ/fallback.html" %}
{% elif civ.interface.is_dicom_image_kind %}
{% include "components/partials/civ/dicom_image.html" %}
{% include "components/partials/civ/dicom_image_set.html" %}
{% else %}
{% include "components/partials/civ/panimg_image.html" %}
{% endif %}
Expand Down
14 changes: 13 additions & 1 deletion app/tests/components_tests/test_partial_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.template.loader import render_to_string

from grandchallenge.components.models import InterfaceKindChoices
from tests.cases_tests.factories import DICOMImageSetFactory
from tests.components_tests.factories import (
ComponentInterfaceFactory,
ComponentInterfaceValueFactory,
Expand Down Expand Up @@ -77,6 +78,14 @@
dict(),
"<a ",
),
( # DICOM_IMAGE_SET
dict(
kind=InterfaceKindChoices.DICOM_IMAGE_SET,
store_in_database=False,
),
dict(),
"<div ",
),
( # Broken / fallback
dict(
kind=InterfaceKindChoices.PANIMG_SEGMENTATION,
Expand Down Expand Up @@ -108,9 +117,12 @@ def test_civ(
ContentFile(b"<bh:ff><bh:d8><bh:ff><bh:e0><bh:00><bh:10>JFIF"),
)

if ci.kind == InterfaceKindChoices.PANIMG_IMAGE:
if ci.kind in InterfaceKindChoices.PANIMG_IMAGE:
civ.image = ImageFactory()
ImageFileFactory(image=civ.image)
elif ci.kind == InterfaceKindChoices.DICOM_IMAGE_SET:
civ.image = ImageFactory()
DICOMImageSetFactory(image=civ.image)

# Actually create the CIV
if (
Expand Down