diff --git a/edc_pharmacy/admin/actions/print_stock_labels.py b/edc_pharmacy/admin/actions/print_stock_labels.py index 327b426..bbb9472 100644 --- a/edc_pharmacy/admin/actions/print_stock_labels.py +++ b/edc_pharmacy/admin/actions/print_stock_labels.py @@ -4,7 +4,7 @@ from django.http import HttpResponseRedirect from django.urls import reverse from edc_label import Label -from edc_protocol import Protocol +from edc_protocol.research_protocol_config import ResearchProtocolConfig @admin.action(permissions=["view"], description="Print medication stock labels") @@ -18,8 +18,8 @@ def print_stock_labels(modeladmin, request, queryset): for i in range(1, obj.qty): stock_identifier = uuid4().hex context = dict( - protocol=Protocol().protocol, - protocol_title=Protocol().protocol_title, + protocol=ResearchProtocolConfig().protocol, + protocol_title=ResearchProtocolConfig().protocol_title, stock_identifier=stock_identifier, barcode_value=stock_identifier, medication_name=obj.product.formulation.medication.display_name, diff --git a/edc_pharmacy/tests/consents.py b/edc_pharmacy/tests/consents.py index 623404e..39c0f91 100644 --- a/edc_pharmacy/tests/consents.py +++ b/edc_pharmacy/tests/consents.py @@ -1,13 +1,13 @@ from edc_consent.consent_definition import ConsentDefinition from edc_consent.site_consents import site_consents from edc_constants.constants import FEMALE, MALE -from edc_protocol import Protocol +from edc_protocol.research_protocol_config import ResearchProtocolConfig consent_v1 = ConsentDefinition( "edc_pharmacy.subjectconsent", version="1", - start=Protocol().study_open_datetime, - end=Protocol().study_close_datetime, + start=ResearchProtocolConfig().study_open_datetime, + end=ResearchProtocolConfig().study_close_datetime, age_min=18, age_is_adult=18, age_max=64, diff --git a/edc_pharmacy/tests/tests/test_study_medication_crf.py b/edc_pharmacy/tests/tests/test_study_medication_crf.py index 47e576a..1054380 100644 --- a/edc_pharmacy/tests/tests/test_study_medication_crf.py +++ b/edc_pharmacy/tests/tests/test_study_medication_crf.py @@ -13,7 +13,7 @@ from edc_appointment.utils import get_next_appointment from edc_constants.constants import YES from edc_facility import import_holidays -from edc_protocol import Protocol +from edc_protocol.research_protocol_config import ResearchProtocolConfig from edc_registration.models import RegisteredSubject from edc_utils import get_utcnow from edc_visit_schedule.site_visit_schedules import site_visit_schedules @@ -401,8 +401,8 @@ def test_for_all_appts(self): ) def test_study_medication_form_baseline(self): - self.study_open_datetime = Protocol().study_open_datetime - self.study_close_datetime = Protocol().study_close_datetime + self.study_open_datetime = ResearchProtocolConfig().study_open_datetime + self.study_close_datetime = ResearchProtocolConfig().study_close_datetime appointment = Appointment.objects.all().order_by("timepoint", "visit_code_sequence")[0] next_appointment = get_next_appointment(appointment, include_interim=True) subject_visit = SubjectVisit.objects.create( diff --git a/runtests.py b/runtests.py index fb6369d..4c65344 100644 --- a/runtests.py +++ b/runtests.py @@ -3,7 +3,6 @@ from pathlib import Path from dateutil.relativedelta import relativedelta -from edc_constants.constants import IGNORE from edc_test_utils import DefaultTestSettings, func_main from edc_utils import get_utcnow @@ -12,7 +11,7 @@ project_settings = DefaultTestSettings( calling_file=__file__, - EDC_NAVBAR_VERIFY_ON_LOAD=IGNORE, + SILENCED_SYSTEM_CHECKS=["sites.E101", "edc_navbar.E002", "edc_navbar.E003"], EDC_AUTH_CODENAMES_WARN_ONLY=True, EDC_AUTH_SKIP_SITE_AUTHS=True, EDC_AUTH_SKIP_AUTH_UPDATER=True, @@ -27,9 +26,43 @@ get_utcnow().replace(microsecond=999999, second=59, minute=59, hour=11) + relativedelta(years=6) ), + INSTALLED_APPS=[ + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", + "django.contrib.sites", + "django_crypto_fields.apps.AppConfig", + "multisite", + "edc_action_item.apps.AppConfig", + "edc_appointment.apps.AppConfig", + "edc_auth.apps.AppConfig", + "edc_data_manager.apps.AppConfig", + "edc_device.apps.AppConfig", + "edc_facility.apps.AppConfig", + "edc_form_runners.apps.AppConfig", + "edc_identifier.apps.AppConfig", + "edc_lab.apps.AppConfig", + "edc_label.apps.AppConfig", + "edc_locator.apps.AppConfig", + "edc_metadata.apps.AppConfig", + "edc_notification.apps.AppConfig", + "edc_offstudy.apps.AppConfig", + "edc_randomization.apps.AppConfig", + "edc_registration.apps.AppConfig", + "edc_sites.apps.AppConfig", + "edc_timepoint.apps.AppConfig", + "edc_visit_schedule.apps.AppConfig", + "edc_visit_tracking.apps.AppConfig", + "edc_prn.apps.AppConfig", + "edc_pdf_reports.apps.AppConfig", + "edc_pharmacy.apps.AppConfig", + "edc_appconfig.apps.AppConfig", + ], add_dashboard_middleware=True, add_lab_dashboard_middleware=True, - excluded_apps=["edc_adverse_event.apps.AppConfig", "adverse_event_app.apps.AppConfig"], ).settings