refactor: update prerequisites queryset assignment in CaseCollectionForm and improve test assertions

This commit is contained in:
Ross
2026-06-10 21:20:30 +01:00
parent ddfb591921
commit 145aa442f0
3 changed files with 9 additions and 14 deletions
+3 -1
View File
@@ -131,7 +131,9 @@ def test_collection(db, create_case_collection, create_case, make_case, client,
# Check that sorting the exam works
# First attempt is not logged in
assertRedirects(response, f"{reverse('login')}?next=%2Fatlas%2Fcollection%2F1%2Fjson_edit")
from urllib.parse import quote
expected_next = quote(reverse("atlas:exam_json_edit", kwargs={"pk": collection.pk}))
assertRedirects(response, f"{reverse('login')}?next={expected_next}")
client.force_login(create_user)
@@ -2,7 +2,7 @@ from __future__ import annotations
import pytest
from atlas.models import SeriesImage, _populate_case_study_date_on_series_image_save
from atlas.models import SeriesImage
@pytest.mark.django_db
@@ -10,11 +10,4 @@ def test_series_viewer_stack_description_includes_plane_and_contrast(create_seri
series = create_series
assert series.get_viewer_stack_description() == "Test Examination (Test Plane) / Test Contrast"
assert series.get_series_dicom_json()["SeriesDescription"] == "Test Examination (Test Plane) / Test Contrast"
@pytest.mark.django_db
def test_series_image_save_hook_handles_missing_basic_dicom_tags(create_series):
image = SeriesImage(series=create_series)
_populate_case_study_date_on_series_image_save(SeriesImage, image)
assert series.get_series_dicom_json()["SeriesDescription"] == "Test Examination (Test Plane) / Test Contrast"