Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Mar 27, 2024
1 parent 07ad2c0 commit 2675557
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
19 changes: 19 additions & 0 deletions edc_crf/tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,32 @@

from django.db import models
from edc_consent.managers import ConsentObjectsByCdefManager, CurrentSiteByCdefManager
from edc_identifier.managers import SubjectIdentifierManager
from edc_identifier.model_mixins import NonUniqueSubjectIdentifierFieldMixin
from edc_model.models import BaseUuidModel
from edc_registration.model_mixins import UpdatesOrCreatesRegistrationModelMixin
from edc_screening.model_mixins import ScreeningModelMixin
from edc_sites.model_mixins import SiteModelMixin
from edc_utils import get_utcnow
from edc_visit_schedule.model_mixins import OffScheduleModelMixin, OnScheduleModelMixin

from edc_crf.model_mixins import CrfModelMixin, CrfStatusModelMixin
from edc_crf.tests.consents import consent_v1


class OnSchedule(SiteModelMixin, OnScheduleModelMixin, BaseUuidModel):
class Meta(BaseUuidModel.Meta):
pass


class OffSchedule(SiteModelMixin, OffScheduleModelMixin, BaseUuidModel):
class Meta(BaseUuidModel.Meta):
pass


class SubjectScreening(ScreeningModelMixin, BaseUuidModel):
consent_definition = consent_v1
objects = SubjectIdentifierManager()


class SubjectConsent(
Expand Down
5 changes: 4 additions & 1 deletion edc_crf/tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
"edc_navbar.E002",
"edc_navbar.E003",
],
SUBJECT_SCREENING_MODEL="edc_crf.subjectscreening",
SUBJECT_VISIT_MODEL="edc_visit_tracking.subjectvisit",
SUBJECT_VISIT_MISSED_MODEL="visit_schedule_app.subjectvisitmissed",
SUBJECT_VISIT_MISSED_MODEL="edc_visit_tracking.subjectvisitmissed",
INSTALLED_APPS=[
"django.contrib.admin",
"django.contrib.auth",
Expand All @@ -47,11 +48,13 @@
"edc_list_data.apps.AppConfig",
"edc_metadata.apps.AppConfig",
"edc_notification.apps.AppConfig",
"edc_offstudy.apps.AppConfig",
"edc_protocol.apps.AppConfig",
"edc_registration.apps.AppConfig",
"edc_timepoint.apps.AppConfig",
"edc_visit_schedule.apps.AppConfig",
"visit_schedule_app.apps.AppConfig",
"visit_tracking_app.apps.AppConfig",
"edc_visit_tracking.apps.AppConfig",
"edc_auth.apps.AppConfig",
"edc_crf.apps.AppConfig",
Expand Down
2 changes: 1 addition & 1 deletion edc_crf/tests/tests/test_crf_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


@override_settings(
SUBJECT_SCREENING_MODEL="visit_schedule_app.subjectscreening",
SUBJECT_SCREENING_MODEL="edc_crf.subjectscreening",
SITE_ID=10,
)
class CrfTestCase(TestCase):
Expand Down
3 changes: 1 addition & 2 deletions edc_crf/tests/tests/tests_crf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@


@override_settings(
SUBJECT_CONSENT_MODEL="visit_schedule_app.subjectconsent",
SUBJECT_SCREENING_MODEL="visit_schedule_app.subjectscreening",
SUBJECT_SCREENING_MODEL="edc_crf.subjectscreening",
SITE_ID=10,
)
class CrfTestCase(TestCase):
Expand Down
8 changes: 4 additions & 4 deletions edc_crf/tests/visit_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@

schedule = Schedule(
name="schedule",
onschedule_model="visit_schedule_app.onschedule",
offschedule_model="visit_schedule_app.offschedule",
onschedule_model="edc_crf.onschedule",
offschedule_model="edc_crf.offschedule",
appointment_model="edc_appointment.appointment",
consent_definitions=[consent_v1],
)
Expand All @@ -62,8 +62,8 @@

visit_schedule = VisitSchedule(
name="visit_schedule",
offstudy_model="visit_schedule_app.subjectoffstudy",
death_report_model="visit_schedule_app.deathreport",
offstudy_model="edc_offstudy.subjectoffstudy",
death_report_model="edc_crf.deathreport",
)

visit_schedule.add_schedule(schedule)

0 comments on commit 2675557

Please sign in to comment.