Skip to content

Commit

Permalink
update test settings
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Aug 22, 2024
1 parent e1ad555 commit 241bcda
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 37 deletions.
34 changes: 34 additions & 0 deletions edc_glucose/tests/test_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python
import sys
from pathlib import Path

from edc_test_settings.default_test_settings import DefaultTestSettings

app_name = "edc_glucose"

base_dir = Path(__file__).absolute().parent.parent.parent

project_settings = DefaultTestSettings(
calling_file=__file__,
BASE_DIR=base_dir,
APP_NAME=app_name,
SUBJECT_VISIT_MODEL="edc_visit_tracking.subjectvisit",
LIST_MODEL_APP_LABEL="edc_glucose",
SILENCED_SYSTEM_CHECKS=["sites.E101", "edc_navbar.E002", "edc_navbar.E003"],
EDC_AUTH_SKIP_SITE_AUTHS=True,
EDC_AUTH_SKIP_AUTH_UPDATER=True,
EXTRA_INSTALLED_APPS=[
"edc_glucose.apps.AppConfig",
"edc_dx.apps.AppConfig",
"edc_dx_review.apps.AppConfig",
"visit_schedule_app.apps.AppConfig",
],
EDC_DX_LABELS=dict(dm="Diabetes"),
EDC_DX_REVIEW_LIST_MODEL_APP_LABEL="edc_glucose",
add_dashboard_middleware=True,
add_lab_dashboard_middleware=True,
use_test_urls=True,
).settings

for k, v in project_settings.items():
setattr(sys.modules[__name__], k, v)
39 changes: 2 additions & 37 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,5 @@
#!/usr/bin/env python
import logging
from pathlib import Path

from edc_test_utils import DefaultTestSettings, func_main

app_name = "edc_glucose"

base_dir = Path(__file__).absolute().parent

project_settings = DefaultTestSettings(
calling_file=__file__,
BASE_DIR=base_dir,
APP_NAME=app_name,
SUBJECT_VISIT_MODEL="edc_visit_tracking.subjectvisit",
LIST_MODEL_APP_LABEL="edc_glucose",
SILENCED_SYSTEM_CHECKS=["sites.E101", "edc_navbar.E002", "edc_navbar.E003"],
EDC_AUTH_SKIP_SITE_AUTHS=True,
EDC_AUTH_SKIP_AUTH_UPDATER=True,
EXTRA_INSTALLED_APPS=[
"edc_glucose.apps.AppConfig",
"edc_dx.apps.AppConfig",
"edc_dx_review.apps.AppConfig",
"visit_schedule_app.apps.AppConfig",
],
EDC_DX_LABELS=dict(dm="Diabetes"),
EDC_DX_REVIEW_LIST_MODEL_APP_LABEL="edc_glucose",
add_dashboard_middleware=True,
add_lab_dashboard_middleware=True,
use_test_urls=True,
).settings


def main():
func_main(project_settings, *[f"{app_name}.tests"])

from edc_test_settings.func_main import func_main2

if __name__ == "__main__":
logging.basicConfig()
main()
func_main2("edc_glucose.tests.test_settings", "edc_glucose.tests")

0 comments on commit 241bcda

Please sign in to comment.