Skip to content

Commit

Permalink
register consent def in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jan 6, 2024
1 parent eb6dc67 commit e861676
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions edc_export/tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from edc_appointment.creators import UnscheduledAppointmentCreator
from edc_appointment.models import Appointment
from edc_consent.site_consents import AlreadyRegistered
from edc_consent.tests.consent_test_utils import consent_definition_factory
from edc_registration.models import RegisteredSubject
from edc_utils import get_utcnow
from edc_visit_schedule.site_visit_schedules import site_visit_schedules
Expand All @@ -25,6 +27,12 @@ class Helper:
def __init__(self, now=None, subject_identifier=None):
site_visit_schedules._registry = {}
site_visit_schedules.register(visit_schedule1)
for schedule in visit_schedule1.schedules.values():
try:
consent_definition_factory(model=schedule.consent_model)
except AlreadyRegistered:
pass

self.now = now or get_utcnow()
self.subject_identifier = subject_identifier or uuid.uuid4().hex
self.consent_and_put_on_schedule()
Expand Down

0 comments on commit e861676

Please sign in to comment.