Skip to content

Commit

Permalink
Merge branch 'release/1.0.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jan 21, 2025
2 parents fe76bb5 + 27f6058 commit f9ae502
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exclude: tests/etc/user-*

repos:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.10
rev: 1.8.2
hooks:
- id: bandit
args:
Expand Down
32 changes: 32 additions & 0 deletions edc_document_status/tests/test_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python
import sys
from pathlib import Path

from edc_test_settings.default_test_settings import DefaultTestSettings

app_name = "edc_document_status"
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",
INSTALLED_APPS=[
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.staticfiles",
"django_crypto_fields.apps.AppConfig",
"django_revision.apps.AppConfig",
"multisite",
"edc_document_status.apps.AppConfig",
],
add_dashboard_middleware=True,
).settings

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

from edc_test_utils import DefaultTestSettings, func_main

app_name = "edc_document_status"
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",
INSTALLED_APPS=[
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.staticfiles",
"django_crypto_fields.apps.AppConfig",
"django_revision.apps.AppConfig",
"multisite",
"edc_document_status.apps.AppConfig",
],
add_dashboard_middleware=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_document_status.tests.test_settings", "edc_document_status.tests")

0 comments on commit f9ae502

Please sign in to comment.