From 8bfa75e6a1fd7a0f740e63d76df1868f01dd07ed Mon Sep 17 00:00:00 2001 From: erikvw Date: Mon, 22 Jan 2024 07:50:38 -0600 Subject: [PATCH] fix visit schedule in tests --- edc_timepoint/tests/consents.py | 2 +- edc_timepoint/tests/tests/test_timepoints.py | 4 ++-- edc_timepoint/tests/visit_schedule.py | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/edc_timepoint/tests/consents.py b/edc_timepoint/tests/consents.py index 16ad8d8..cd2b57e 100644 --- a/edc_timepoint/tests/consents.py +++ b/edc_timepoint/tests/consents.py @@ -2,7 +2,7 @@ from edc_constants.constants import FEMALE, MALE from edc_protocol import Protocol -v1 = ConsentDefinition( +consent_v1 = ConsentDefinition( "edc_timepoint.subjectconsent", version="1", start=Protocol().study_open_datetime, diff --git a/edc_timepoint/tests/tests/test_timepoints.py b/edc_timepoint/tests/tests/test_timepoints.py index 152d380..298629c 100644 --- a/edc_timepoint/tests/tests/test_timepoints.py +++ b/edc_timepoint/tests/tests/test_timepoints.py @@ -13,7 +13,7 @@ from ...constants import CLOSED_TIMEPOINT, OPEN_TIMEPOINT from ...model_mixins import UnableToCloseTimepoint from ...timepoint import TimepointClosed -from ..consents import v1 +from ..consents import consent_v1 from ..models import CrfOne, CrfTwo, SubjectConsent, SubjectVisit from ..visit_schedule import visit_schedule1 @@ -58,7 +58,7 @@ class TimepointTests(TestCase): @classmethod def setUpClass(cls): import_holidays() - site_consents.register(v1) + site_consents.register(consent_v1) return super().setUpClass() diff --git a/edc_timepoint/tests/visit_schedule.py b/edc_timepoint/tests/visit_schedule.py index 3a48e12..944cfa1 100644 --- a/edc_timepoint/tests/visit_schedule.py +++ b/edc_timepoint/tests/visit_schedule.py @@ -1,9 +1,11 @@ from dateutil.relativedelta import relativedelta from edc_visit_schedule.schedule import Schedule -from edc_visit_schedule.visit import Crf, FormsCollection, Visit +from edc_visit_schedule.visit import Crf, CrfCollection, Visit from edc_visit_schedule.visit_schedule import VisitSchedule -crfs = FormsCollection( +from .consents import consent_v1 + +crfs = CrfCollection( Crf(show_order=1, model="edc_timepoint.crfone", required=True), Crf(show_order=2, model="edc_timepoint.crftwo", required=True), ) @@ -21,7 +23,7 @@ onschedule_model="edc_timepoint.onschedule", offschedule_model="edc_timepoint.offschedule", appointment_model="edc_appointment.appointment", - consent_model="edc_timepoint.subjectconsent", + consent_definitions=[consent_v1], ) visits = []