feat(subjects): add visit drawer and editable screening dates
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_new_ae_records_default_to_follow_up_status():
|
||||
crud_source = Path("app/crud/ae.py").read_text(encoding="utf-8")
|
||||
model_source = Path("app/models/ae.py").read_text(encoding="utf-8")
|
||||
|
||||
assert 'status="FOLLOW_UP"' in crud_source
|
||||
assert 'default="FOLLOW_UP"' in model_source
|
||||
assert 'status="NEW"' not in crud_source
|
||||
assert 'default="NEW"' not in model_source
|
||||
@@ -10,6 +10,7 @@ from app.crud.visit import (
|
||||
validate_early_termination_date,
|
||||
)
|
||||
from app.schemas.study import StudyUpdate
|
||||
from app.schemas.visit import VisitCreate
|
||||
|
||||
|
||||
def test_build_visit_schedule_dates_uses_per_visit_windows():
|
||||
@@ -105,6 +106,19 @@ def test_study_update_allows_multiple_visits_with_same_baseline_offset():
|
||||
assert [item.visit_code for item in payload.visit_schedule or []] == ["筛选访视", "基线访视"]
|
||||
|
||||
|
||||
def test_visit_create_accepts_actual_date_and_notes_for_shared_drawer_create_flow():
|
||||
payload = VisitCreate(
|
||||
subject_id="00000000-0000-0000-0000-000000000001",
|
||||
visit_code="V4",
|
||||
planned_date=date(2026, 6, 1),
|
||||
actual_date=date(2026, 6, 2),
|
||||
notes="现场已完成",
|
||||
)
|
||||
|
||||
assert payload.actual_date == date(2026, 6, 2)
|
||||
assert payload.notes == "现场已完成"
|
||||
|
||||
|
||||
def test_sort_visits_for_display_follows_configured_visit_order_without_dates():
|
||||
visits = [
|
||||
SimpleNamespace(visit_code="V1", planned_date=None),
|
||||
|
||||
Reference in New Issue
Block a user