From 307b1f74bcbc3940e61f43b387934dd37f828d33 Mon Sep 17 00:00:00 2001 From: erikvw Date: Mon, 30 Oct 2023 20:47:44 -0500 Subject: [PATCH 1/2] remove dependency --- edc_action_item/data_fixers.py | 6 +++--- edc_action_item/tests/test_case_mixin.py | 11 ----------- runtests.py | 1 - 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/edc_action_item/data_fixers.py b/edc_action_item/data_fixers.py index 4fa96e7..91fed3a 100644 --- a/edc_action_item/data_fixers.py +++ b/edc_action_item/data_fixers.py @@ -18,9 +18,9 @@ def fix_null_historical_action_identifier(app_label, models): with connection.cursor() as cursor: for model in models: tbl = f"{app_label}_historical{model}" - if not re.match("([a-z]+)_historical_([a-z]+)", tbl): - raise ValueError("Invalid table name when building sql statement") - tbl = re.match("([a-z]+)_historical_([a-z]+)", tbl).group() + if not re.match("([a-z_]+)_historical([a-z]+)", tbl): + raise ValueError(f"Invalid table name when building sql statement. Got {tbl}") + tbl = re.match("([a-z_]+)_historical([a-z]+)", tbl).group() sql = ( f"update {tbl} set action_identifier=id " # nosec B608 "where action_identifier is null" # nosec B608 diff --git a/edc_action_item/tests/test_case_mixin.py b/edc_action_item/tests/test_case_mixin.py index cfd2d81..269dec4 100644 --- a/edc_action_item/tests/test_case_mixin.py +++ b/edc_action_item/tests/test_case_mixin.py @@ -1,7 +1,6 @@ from django.test import TestCase from edc_facility.import_holidays import import_holidays from edc_metadata.tests.models import SubjectConsent -from edc_reference import ReferenceModelConfig, site_reference_configs from edc_registration.models import RegisteredSubject from edc_utils import get_utcnow from edc_visit_schedule.site_visit_schedules import site_visit_schedules @@ -18,20 +17,10 @@ def setUpTestData(cls): def enroll(subject_identifier=None): subject_identifier = subject_identifier or "1111111" - site_reference_configs.registry = {} - reference = ReferenceModelConfig( - name="edc_action_item.CrfLongitudinalOne", fields=["f1", "f2", "f3"] - ) - site_reference_configs.register(reference) - site_visit_schedules._registry = {} site_visit_schedules.loaded = False site_visit_schedules.register(visit_schedule) - site_reference_configs.register_from_visit_schedule( - visit_models={"edc_appointment.appointment": "edc_visit_tracking.subjectvisit"} - ) - subject_consent = SubjectConsent.objects.create( subject_identifier=subject_identifier, consent_datetime=get_utcnow() ) diff --git a/runtests.py b/runtests.py index ead19b1..c1627aa 100644 --- a/runtests.py +++ b/runtests.py @@ -46,7 +46,6 @@ "edc_lab.apps.AppConfig", "edc_navbar.apps.AppConfig", "edc_offstudy.apps.AppConfig", - "edc_reference.apps.AppConfig", "edc_metadata.apps.AppConfig", "edc_protocol.apps.AppConfig", "edc_identifier.apps.AppConfig", From f6045bd4493ebae63ca0855528d7da6c56554389 Mon Sep 17 00:00:00 2001 From: erikvw Date: Mon, 30 Oct 2023 21:24:44 -0500 Subject: [PATCH 2/2] remove edc-reference as a dependency --- runtests.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/runtests.py b/runtests.py index c1627aa..c7e1562 100644 --- a/runtests.py +++ b/runtests.py @@ -33,10 +33,6 @@ "django.contrib.sites", "django_crypto_fields.apps.AppConfig", "django_revision.apps.AppConfig", - # "rest_framework", - # "rest_framework.authtoken", - # "django_collect_offline.apps.AppConfig", - # "django_collect_offline_files.apps.AppConfig", "simple_history", "multisite", "edc_auth.apps.AppConfig",