Skip to content

Commit

Permalink
Merge branch 'release/0.3.99' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jan 11, 2025
2 parents 8a7f8fa + 3d15ee1 commit 30b2e2a
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 19 deletions.
5 changes: 4 additions & 1 deletion edc_metadata/tests/consents.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from datetime import datetime
from zoneinfo import ZoneInfo

from dateutil.relativedelta import relativedelta
from edc_consent.consent_definition import ConsentDefinition
from edc_constants.constants import FEMALE, MALE

from .constants import test_datetime
test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))

consent_v1 = ConsentDefinition(
"edc_metadata.subjectconsentv1",
Expand Down
4 changes: 0 additions & 4 deletions edc_metadata/tests/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
from datetime import datetime
from zoneinfo import ZoneInfo

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("utc"))
6 changes: 5 additions & 1 deletion edc_metadata/tests/tests/metadata_test_mixin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

import time_machine
from dateutil.relativedelta import relativedelta
from django.test import TestCase
Expand All @@ -11,10 +14,11 @@
from edc_visit_schedule.site_visit_schedules import site_visit_schedules

from ...models import CrfMetadata, RequisitionMetadata
from ..constants import test_datetime
from ..models import SubjectConsentV1
from ..visit_schedule import get_visit_schedule

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


class TestMetadataMixin(TestCase):
@classmethod
Expand Down
7 changes: 6 additions & 1 deletion edc_metadata/tests/tests/test_crf_rule_group_gender.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

import time_machine
from dateutil.relativedelta import relativedelta
from django.test import TestCase, override_settings
Expand Down Expand Up @@ -28,13 +31,15 @@
)
from edc_metadata.models import CrfMetadata

from ..constants import test_datetime
from ..models import CrfOne, SubjectConsentV1
from ..visit_schedule import get_visit_schedule

fake = Faker()


test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


class CrfRuleGroupWithSourceModel(CrfRuleGroup):
"""Specifies source model."""

Expand Down
5 changes: 4 additions & 1 deletion edc_metadata/tests/tests/test_crf_rule_groups.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

import time_machine
from dateutil.relativedelta import relativedelta
from django.apps import apps as django_apps
Expand All @@ -19,12 +22,12 @@
from edc_metadata.metadata_rules import CrfRule, CrfRuleGroup, P, site_metadata_rules
from edc_metadata.models import CrfMetadata

from ..constants import test_datetime
from ..models import CrfOne, CrfTwo, PrnOne, SubjectConsentV1
from ..visit_schedule import get_visit_schedule

fake = Faker()
edc_registration_app_config = django_apps.get_app_config("edc_registration")
test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


class CrfRuleGroupOne(CrfRuleGroup):
Expand Down
6 changes: 5 additions & 1 deletion edc_metadata/tests/tests/test_form_mixin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

import time_machine
from dateutil.relativedelta import relativedelta
from django.contrib.auth.models import User
Expand All @@ -18,11 +21,12 @@
from edc_metadata.metadata_rules import site_metadata_rules
from edc_metadata.models import CrfMetadata, RequisitionMetadata

from ..constants import test_datetime
from ..models import SubjectConsentV1, SubjectVisit
from ..visit_schedule import get_visit_schedule
from .test_view_mixin import MyView

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


class MyForm(MetadataHelperMixin, FormValidator):
pass
Expand Down
6 changes: 5 additions & 1 deletion edc_metadata/tests/tests/test_metadata_creator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

from dateutil.relativedelta import relativedelta
from django.test import TestCase, override_settings
from edc_appointment.constants import IN_PROGRESS_APPT, MISSED_APPT
Expand All @@ -7,10 +10,11 @@
from edc_metadata.metadata_updater import MetadataUpdater
from edc_metadata.models import CrfMetadata, RequisitionMetadata

from ..constants import test_datetime
from ..models import SubjectVisit
from .metadata_test_mixin import TestMetadataMixin

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


@override_settings(
EDC_PROTOCOL_STUDY_OPEN_DATETIME=test_datetime - relativedelta(years=3),
Expand Down
6 changes: 5 additions & 1 deletion edc_metadata/tests/tests/test_metadata_getter.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
from datetime import datetime
from zoneinfo import ZoneInfo

from dateutil.relativedelta import relativedelta
from django.test import TestCase, override_settings
from edc_visit_tracking.constants import SCHEDULED

from ...constants import REQUIRED
from ...metadata import CrfMetadataGetter
from ...next_form_getter import NextFormGetter
from ..constants import test_datetime
from ..models import CrfOne, CrfThree, CrfTwo, SubjectVisit
from .metadata_test_mixin import TestMetadataMixin

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


@override_settings(
EDC_PROTOCOL_STUDY_OPEN_DATETIME=test_datetime - relativedelta(years=3),
Expand Down
6 changes: 5 additions & 1 deletion edc_metadata/tests/tests/test_metadata_refresher.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

from dateutil.relativedelta import relativedelta
from django.core.exceptions import ObjectDoesNotExist
from django.test import TestCase, override_settings
Expand All @@ -14,10 +17,11 @@
from edc_metadata.metadata_refresher import MetadataRefresher
from edc_metadata.models import CrfMetadata

from ..constants import test_datetime
from ..models import CrfFive, CrfOne, SubjectVisit
from .metadata_test_mixin import TestMetadataMixin

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


@override_settings(
EDC_PROTOCOL_STUDY_OPEN_DATETIME=test_datetime - relativedelta(years=3),
Expand Down
6 changes: 5 additions & 1 deletion edc_metadata/tests/tests/test_metadata_updater.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

from dateutil.relativedelta import relativedelta
from django.core.exceptions import ObjectDoesNotExist
from django.test import TestCase, override_settings
Expand All @@ -9,10 +12,11 @@
from edc_metadata.metadata_updater import MetadataUpdater
from edc_metadata.models import CrfMetadata, RequisitionMetadata

from ..constants import test_datetime
from ..models import CrfOne, CrfThree, CrfTwo, SubjectRequisition, SubjectVisit
from .metadata_test_mixin import TestMetadataMixin

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


@override_settings(
EDC_PROTOCOL_STUDY_OPEN_DATETIME=test_datetime - relativedelta(years=3),
Expand Down
5 changes: 4 additions & 1 deletion edc_metadata/tests/tests/test_natural_keys.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import unittest
from datetime import datetime
from zoneinfo import ZoneInfo

from dateutil.relativedelta import relativedelta
from django.apps import apps as django_apps
Expand All @@ -16,10 +18,11 @@
from edc_visit_tracking.models import SubjectVisit
from faker import Faker

from ..constants import test_datetime
from ..models import SubjectConsentV1
from ..visit_schedule import get_visit_schedule

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))

skip_condition = "django_collect_offline.apps.AppConfig" not in settings.INSTALLED_APPS
skip_reason = "django_collect_offline not installed"
if not skip_condition:
Expand Down
5 changes: 4 additions & 1 deletion edc_metadata/tests/tests/test_persistant_singleton.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from copy import deepcopy
from datetime import datetime
from zoneinfo import ZoneInfo

import time_machine
from dateutil.relativedelta import relativedelta
Expand Down Expand Up @@ -32,10 +34,11 @@
)
from edc_metadata.models import CrfMetadata

from ..constants import test_datetime
from ..models import CrfOne, SubjectConsent
from ..visit_schedule2 import get_visit_schedule

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


class CrfOneForm(forms.ModelForm):
class Meta:
Expand Down
6 changes: 5 additions & 1 deletion edc_metadata/tests/tests/test_predicates.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

import time_machine
from dateutil.relativedelta import relativedelta
from django.test import TestCase, override_settings
Expand All @@ -15,10 +18,11 @@

from edc_metadata.metadata_rules import PF, P

from ..constants import test_datetime
from ..models import CrfOne, SubjectConsentV1
from ..visit_schedule import get_visit_schedule

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))

fake = Faker()


Expand Down
6 changes: 5 additions & 1 deletion edc_metadata/tests/tests/test_requisition_rule_group.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

import time_machine
from dateutil.relativedelta import relativedelta
from django.core.exceptions import ObjectDoesNotExist
Expand All @@ -24,10 +27,11 @@
)
from edc_metadata.models import RequisitionMetadata

from ..constants import test_datetime
from ..models import CrfOne, SubjectConsentV1, SubjectRequisition
from ..visit_schedule import get_visit_schedule

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))

fake = Faker()


Expand Down
5 changes: 4 additions & 1 deletion edc_metadata/tests/tests/test_site_metadata_rules.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from zoneinfo import ZoneInfo

from dateutil.relativedelta import relativedelta
from django.test import TestCase, override_settings
from edc_consent import site_consents
Expand All @@ -17,7 +20,7 @@
site_metadata_rules,
)

from ..constants import test_datetime
test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


class RuleGroupWithoutRules(CrfRuleGroup):
Expand Down
5 changes: 4 additions & 1 deletion edc_metadata/tests/tests/test_view_mixin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from datetime import datetime
from unittest.mock import MagicMock
from zoneinfo import ZoneInfo

import time_machine
from dateutil.relativedelta import relativedelta
Expand All @@ -22,10 +24,11 @@

from ...models import CrfMetadata, RequisitionMetadata
from ...view_mixins import MetadataViewMixin
from ..constants import test_datetime
from ..models import CrfOne, CrfThree, SubjectConsent
from ..visit_schedule import get_visit_schedule

test_datetime = datetime(2019, 6, 11, 8, 00, tzinfo=ZoneInfo("UTC"))


class DummyCrfModelWrapper:
def __init__(self, **kwargs):
Expand Down

0 comments on commit 30b2e2a

Please sign in to comment.