fix collection ordering
This commit is contained in:
+45
-3
@@ -107,10 +107,52 @@ def create_case(
|
||||
case.presentation.add(presentation)
|
||||
case.pathological_process.add(pathological_process)
|
||||
case.author.add(user)
|
||||
case.editor.add(user)
|
||||
|
||||
return case
|
||||
|
||||
@pytest.fixture
|
||||
def make_case(create_subspecialty, create_condition, create_presentation, create_pathological_process):
|
||||
def _make_case(
|
||||
title="Sample Case",
|
||||
description="Sample description",
|
||||
history="Sample history",
|
||||
discussion="Sample discussion",
|
||||
report="Sample report",
|
||||
diagnostic_certainty=Case.CertaintyChoices.LIKELY,
|
||||
verified=True,
|
||||
created_date=timezone.now(),
|
||||
published_date=timezone.now(),
|
||||
archive=False,
|
||||
open_access=True,
|
||||
):
|
||||
subspecialty = create_subspecialty
|
||||
condition = create_condition
|
||||
presentation = create_presentation
|
||||
pathological_process = create_pathological_process
|
||||
user, _ = get_user_model().objects.get_or_create(
|
||||
username="Test User 2", password="Test Password", email="test@emai.com")
|
||||
|
||||
case = Case.objects.create(
|
||||
title=title,
|
||||
description=description,
|
||||
history=history,
|
||||
discussion=discussion,
|
||||
report=report,
|
||||
diagnostic_certainty=diagnostic_certainty,
|
||||
verified=verified,
|
||||
created_date=created_date,
|
||||
published_date=published_date,
|
||||
archive=archive,
|
||||
open_access=open_access,
|
||||
)
|
||||
case.subspecialty.add(subspecialty)
|
||||
case.condition.add(condition)
|
||||
case.presentation.add(presentation)
|
||||
case.pathological_process.add(pathological_process)
|
||||
case.author.add(user)
|
||||
|
||||
return case
|
||||
return _make_case
|
||||
|
||||
@pytest.fixture
|
||||
def create_series(create_modality, create_examination, create_plane, create_contrast, create_user):
|
||||
@@ -141,12 +183,12 @@ def create_series_image():
|
||||
|
||||
@pytest.fixture
|
||||
def create_series_finding():
|
||||
return SeriesFinding.objects.create()
|
||||
return SeriesFinding.objects.create(description="Test Description")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def create_case_collection():
|
||||
return CaseCollection.objects.create()
|
||||
return CaseCollection.objects.create(name="Test Collection")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in New Issue
Block a user