Skip to content

Commit 396f39c

Browse files
committed
Merge branch 'release/0.3.1' into main
2 parents b0333e8 + dfeb032 commit 396f39c

File tree

5 files changed

+26
-58
lines changed

5 files changed

+26
-58
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
python-version: ['3.11']
15-
django-version: ['4.2', 'dev']
14+
python-version: ['3.11', '3.12']
15+
django-version: ['4.2', '5.0', 'dev']
16+
17+
exclude:
18+
- python-version: '3.12'
19+
django-version: '4.2'
20+
- python-version: '3.11'
21+
django-version: 'dev'
1622
services:
1723
mysql:
1824
image: mysql:latest

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Classes to manage glucose, ifg and ogtt
99
.. |pypi| image:: https://img.shields.io/pypi/v/edc-glucose.svg
1010
:target: https://pypi.python.org/pypi/edc-glucose
1111

12-
.. |actions| image:: https://github.com/clinicedc/edc-glucose/workflows/build/badge.svg?branch=develop
13-
:target: https://github.com/clinicedc/edc-glucose/actions?query=workflow:build
12+
.. |actions| image:: https://github.com/clinicedc/edc-glucose/actions/workflows/build.yml/badge.svg
13+
:target: https://github.com/clinicedc/edc-glucose/actions/workflows/build.yml
1414

1515
.. |codecov| image:: https://codecov.io/gh/clinicedc/edc-glucose/branch/develop/graph/badge.svg
1616
:target: https://codecov.io/gh/clinicedc/edc-glucose

edc_glucose/tests/tests/test_glucose_form_validator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from _decimal import Decimal
22
from django.core.exceptions import ValidationError
3-
from django.test import TestCase
3+
from django.test import TestCase, override_settings
44
from edc_appointment.constants import SCHEDULED_APPT
55
from edc_appointment.models import Appointment
66
from edc_constants.constants import NOT_APPLICABLE, YES
@@ -15,6 +15,7 @@
1515
from edc_glucose.tests.visit_schedules import visit_schedule
1616

1717

18+
@override_settings(SITE_ID=10)
1819
class TestGlucose(TestCase):
1920
def setUp(self):
2021
site_visit_schedules._registry = {}

pyproject.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,22 @@ exclude_lines = [
3535
legacy_tox_ini = """
3636
[tox]
3737
envlist =
38-
py{311}-dj{42,dev},
38+
py{311}-dj{42,50},
39+
py{312}-dj{50,dev},
3940
lint
4041
4142
isolated_build = true
4243
4344
[gh-actions]
4445
python =
45-
3.11: py311, lint
46+
3.11: py311
47+
3.12: py312, lint
4648
4749
[gh-actions:env]
4850
DJANGO =
49-
4.2: dj42, lint
50-
dev: djdev
51+
4.2: dj42
52+
5.0: dj50
53+
dev: djdev, lint
5154
5255
[testenv]
5356
deps =
@@ -56,6 +59,7 @@ deps =
5659
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/edc.txt
5760
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/third_party_dev.txt
5861
dj42: Django>=4.2,<5.0
62+
dj50: Django>=5.0
5963
djdev: https://github.com/django/django/tarball/main
6064
6165
commands =

runtests.py

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
#!/usr/bin/env python
22
import logging
3-
import sys
4-
from os.path import abspath, dirname, join
3+
from pathlib import Path
54

6-
import django
7-
from django.conf import settings
8-
from django.test.runner import DiscoverRunner
95
from edc_constants.constants import IGNORE
10-
from edc_test_utils import DefaultTestSettings
6+
from edc_test_utils import DefaultTestSettings, func_main
117

12-
base_dir = dirname(abspath(__file__))
138
app_name = "edc_glucose"
149

15-
DEFAULT_SETTINGS = DefaultTestSettings(
10+
base_dir = Path(__file__).absolute().parent
11+
12+
project_settings = DefaultTestSettings(
1613
calling_file=__file__,
1714
BASE_DIR=base_dir,
1815
APP_NAME=app_name,
19-
ETC_DIR=join(base_dir, app_name, "tests", "etc"),
20-
# SUBJECT_SCREENING_MODEL=f"edc_screening.subjectscreening",
21-
# SUBJECT_CONSENT_MODEL=f"edc_metadata.subjectconsent",
2216
SUBJECT_VISIT_MODEL="edc_visit_tracking.subjectvisit",
23-
# SUBJECT_VISIT_MISSED_MODEL=f"edc_metadata.subjectvisitmissed",
24-
# SUBJECT_REQUISITION_MODEL=f"edc_metadata.subjectrequisition",
2517
LIST_MODEL_APP_LABEL="edc_glucose",
2618
EDC_NAVBAR_VERIFY_ON_LOAD=IGNORE,
2719
EDC_AUTH_SKIP_SITE_AUTHS=True,
@@ -34,49 +26,14 @@
3426
],
3527
EDC_DX_LABELS=dict(dm="Diabetes"),
3628
EDC_DX_REVIEW_LIST_MODEL_APP_LABEL="edc_glucose",
37-
# INSTALLED_APPS=[
38-
# "django.contrib.admin",
39-
# "django.contrib.auth",
40-
# "django.contrib.contenttypes",
41-
# "django.contrib.sessions",
42-
# "django.contrib.messages",
43-
# "django.contrib.staticfiles",
44-
# "django.contrib.sites",
45-
# "django_crypto_fields.apps.AppConfig",
46-
# "django_revision.apps.AppConfig",
47-
# "multisite",
48-
# "edc_appointment.apps.AppConfig",
49-
# "edc_action_item.apps.AppConfig",
50-
# "edc_crf.apps.AppConfig",
51-
# "edc_device.apps.AppConfig",
52-
# # "edc_dashboard.apps.AppConfig",
53-
# "edc_facility.apps.AppConfig",
54-
# "edc_lab.apps.AppConfig",
55-
# "edc_metadata.apps.AppConfig",
56-
# "edc_offstudy.apps.AppConfig",
57-
# "edc_registration.apps.AppConfig",
58-
# "edc_identifier.apps.AppConfig",
59-
# "edc_notification.apps.AppConfig",
60-
# "edc_sites.apps.AppConfig",
61-
# "edc_timepoint.apps.AppConfig",
62-
# "edc_visit_schedule.apps.AppConfig",
63-
# "edc_visit_tracking.apps.AppConfig",
64-
# "edc_glucose.apps.AppConfig",
65-
# ],
66-
RANDOMIZATION_LIST_PATH=join(base_dir, app_name, "tests", "test_randomization_list.csv"),
6729
add_dashboard_middleware=True,
6830
add_lab_dashboard_middleware=True,
6931
use_test_urls=True,
7032
).settings
7133

7234

7335
def main():
74-
if not settings.configured:
75-
settings.configure(**DEFAULT_SETTINGS)
76-
django.setup()
77-
tags = [t.split("=")[1] for t in sys.argv if t.startswith("--tag")]
78-
failures = DiscoverRunner(failfast=False, tags=tags).run_tests([f"{app_name}.tests"])
79-
sys.exit(failures)
36+
func_main(project_settings, *[f"{app_name}.tests"])
8037

8138

8239
if __name__ == "__main__":

0 commit comments

Comments
 (0)