Skip to content

Commit

Permalink
Merge branch 'release/0.3.69' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Dec 14, 2023
2 parents 9b03cf0 + d59ef4c commit 9e3a16c
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 104 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
django-version: ['4.2', 'dev']
python-version: ['3.11', '3.12']
django-version: ['4.2', '5.0', 'dev']

exclude:
- python-version: '3.12'
django-version: '4.2'
- python-version: '3.11'
django-version: 'dev'
services:
mysql:
image: mysql:latest
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ For example:
.. |pypi| image:: https://img.shields.io/pypi/v/edc-data-manager.svg
:target: https://pypi.python.org/pypi/edc-data-manager

.. |actions| image:: https://github.com/clinicedc/edc-data-manager/workflows/build/badge.svg?branch=develop
:target: https://github.com/clinicedc/edc-data-manager/actions?query=workflow:build
.. |actions| image:: https://github.com/clinicedc/edc-data-manager/actions/workflows/build.yml/badge.svg
:target: https://github.com/clinicedc/edc-data-manager/actions/workflows/build.yml

.. |codecov| image:: https://codecov.io/gh/clinicedc/edc-data-manager/branch/develop/graph/badge.svg
:target: https://codecov.io/gh/clinicedc/edc-data-manager
Expand Down
61 changes: 61 additions & 0 deletions data_manager_app/sites.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from edc_sites.single_site import SingleSite
from edc_sites.site import sites

suffix = "clinicedc.org"
language_codes = ["en"]
sites.register(
SingleSite(
10,
"mochudi",
title="Mochudi",
country="botswana",
country_code="bw",
language_codes=language_codes,
domain=f"mochudi.bw.{suffix}",
),
SingleSite(
20,
"molepolole",
title="Molepolole",
country="botswana",
country_code="bw",
language_codes=language_codes,
domain=f"molepolole.bw.{suffix}",
),
SingleSite(
30,
"lobatse",
title="Lobatse",
country="botswana",
country_code="bw",
language_codes=language_codes,
domain=f"lobatse.bw.{suffix}",
),
SingleSite(
40,
"gaborone",
title="Gaborone",
country="botswana",
country_code="bw",
language_codes=language_codes,
domain=f"gaborone.bw.{suffix}",
),
SingleSite(
50,
"karakobis",
title="Karakobis",
country="botswana",
country_code="bw",
language_codes=language_codes,
domain=f"karakobis.bw.{suffix}",
),
SingleSite(
60,
"windhoek",
title="Windhoek",
country="namibia",
country_code="na",
language_codes=language_codes,
domain=f"windhoek.bw.{suffix}",
),
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Django 4.2.1 on 2023-07-05 02:16

from django.db import migrations
import django.db.models.manager
import edc_sites.model_mixins
import edc_sites.models
from django.db import migrations


class Migration(migrations.Migration):
Expand Down Expand Up @@ -50,7 +50,7 @@ class Migration(migrations.Migration):
migrations.AlterModelManagers(
name="dataquery",
managers=[
("on_site", edc_sites.model_mixins.CurrentSiteManager()),
("on_site", edc_sites.models.CurrentSiteManager()),
("objects", django.db.models.manager.Manager()),
],
),
Expand Down
6 changes: 3 additions & 3 deletions edc_data_manager/migrations/0029_alter_dataquery_managers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Django 4.2.1 on 2023-07-07 19:32

from django.db import migrations
import django.db.models.manager
import edc_sites.model_mixins
import edc_sites.models
from django.db import migrations


class Migration(migrations.Migration):
Expand All @@ -18,7 +18,7 @@ class Migration(migrations.Migration):
name="dataquery",
managers=[
("objects", django.db.models.manager.Manager()),
("on_site", edc_sites.model_mixins.CurrentSiteManager()),
("on_site", edc_sites.models.CurrentSiteManager()),
],
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 5.0 on 2023-12-08 00:49

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("edc_data_manager", "0035_datadictionary_edc_data_ma_model_92b469_idx"),
]

operations = [
migrations.AlterField(
model_name="historicalqueryrule",
name="rule_handler_name",
field=models.CharField(
choices="(('do_nothing', 'Do Nothing'), ('default', 'Default'))",
default="default",
max_length=150,
),
),
migrations.AlterField(
model_name="queryrule",
name="rule_handler_name",
field=models.CharField(
choices="(('do_nothing', 'Do Nothing'), ('default', 'Default'))",
default="default",
max_length=150,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 5.0 on 2023-12-13 14:26

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
(
"edc_data_manager",
"0036_alter_historicalqueryrule_rule_handler_name_and_more",
),
]

operations = [
migrations.AlterField(
model_name="historicalqueryrule",
name="rule_handler_name",
field=models.CharField(
choices="(('do_nothing', 'Do Nothing'), ('default', 'Default'))",
default="default",
max_length=150,
),
),
migrations.AlterField(
model_name="queryrule",
name="rule_handler_name",
field=models.CharField(
choices="(('do_nothing', 'Do Nothing'), ('default', 'Default'))",
default="default",
max_length=150,
),
),
]
56 changes: 0 additions & 56 deletions edc_data_manager/modeladmin_mixins.py

This file was deleted.

3 changes: 1 addition & 2 deletions edc_data_manager/tests/tests/test_auths.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@


@override_settings(
EDC_AUTH_SKIP_SITE_AUTHS=False,
EDC_AUTH_SKIP_AUTH_UPDATER=False,
EDC_AUTH_SKIP_SITE_AUTHS=False, EDC_AUTH_SKIP_AUTH_UPDATER=False, SITE_ID=20
)
class TestAuths(TestCase):
def test_load(self):
Expand Down
15 changes: 7 additions & 8 deletions edc_data_manager/tests/tests/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@


@override_settings(
EDC_AUTH_SKIP_SITE_AUTHS=False,
EDC_AUTH_SKIP_AUTH_UPDATER=False,
EDC_AUTH_SKIP_SITE_AUTHS=False, EDC_AUTH_SKIP_AUTH_UPDATER=False, SITE_ID=20
)
class AdminSiteTest(WebTest):
@classmethod
Expand Down Expand Up @@ -158,13 +157,13 @@ def test_data_query_add_and_permissions(self):
response = form.submit().follow()

self.assertIn("was added successfully", str(response))
self.app.get(reverse("edc_auth_admin:logout"), user=self.user, status=200)
# self.app.get(reverse("edc_auth_admin:logout"), user=self.user, status=200)

login(
self,
superuser=False,
redirect_url="admin:index",
)
# login(
# self,
# superuser=False,
# redirect_url="admin:index",
# )

data_query = DataQuery.objects.get(title="My first query")
url = reverse(
Expand Down
8 changes: 6 additions & 2 deletions edc_data_manager/tests/tests/test_query_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from dateutil.relativedelta import relativedelta
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.test import TestCase, override_settings
from edc_appointment.models import Appointment
from edc_constants.constants import NO, OPEN, YES
from edc_facility.import_holidays import import_holidays
Expand Down Expand Up @@ -41,9 +41,13 @@
User = get_user_model()


@override_settings(SITE_ID=20)
class TestQueryRules(TestCase):
def setUp(self):
@classmethod
def setUpTestData(cls):
import_holidays()

def setUp(self):
self.user = User.objects.create_superuser("user_login", "u@example.com", "pass")

site_labs._registry = {}
Expand Down
3 changes: 2 additions & 1 deletion edc_data_manager/tests/tests/test_serializer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib.auth import get_user_model
from django.core import serializers
from django.test import TestCase
from django.test import TestCase, override_settings
from edc_lab.site_labs import site_labs
from edc_visit_schedule.apps import populate_visit_schedule
from edc_visit_schedule.constants import HOURS
Expand All @@ -13,6 +13,7 @@
from edc_data_manager.models.user import DataManagerUser, QueryUser


@override_settings(SITE_ID=20)
class TestSerializer(TestCase):
def setUp(self):
self.user = get_user_model().objects.create_superuser(
Expand Down
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ exclude_lines = [
legacy_tox_ini = """
[tox]
envlist =
py{310}-dj{41,42},
py{311}-dj{41,42,dev},
py{311}-dj{42,50},
py{312}-dj{50,dev},
lint
isolated_build = true
[gh-actions]
python =
3.10: py310
3.11: py311, lint
3.11: py311
3.12: py312, lint
[gh-actions:env]
DJANGO =
4.1: dj41
4.2: dj42, lint
dev: djdev
4.2: dj42
5.0: dj50
dev: djdev, lint
[testenv]
deps =
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/tox.txt
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/test_utils.txt
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/edc.txt
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/third_party_dev.txt
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<5.0
dj50: Django>=5.0
djdev: https://github.com/django/django/tarball/main
commands =
Expand Down
Loading

0 comments on commit 9e3a16c

Please sign in to comment.