diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index d020cc9..dafb3cf 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -3,12 +3,20 @@ on: [pull_request, workflow_dispatch] jobs: test: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + django-version: ["3.2", "4.2", "5.0"] steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: '3.11' - - run: pip install django django-rest-framework pytest pytest-django pytest-lazy-fixture pytest-cov + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install django~=${{ matrix.django-version }} + pip install django-rest-framework pytest pytest-django pytest-lazy-fixture pytest-cov - name: Run pytest env: PYTHONPATH: tests/project/:src/ diff --git a/pyproject.toml b/pyproject.toml index efc19b0..d47cc58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,7 @@ testing = [ "pytest-lazy-fixture", "pytest-randomly", "pytest-xdist", + "tox", ] [project.urls] diff --git a/tests/project/settings.py b/tests/project/settings.py index 8a77b54..d1f808b 100644 --- a/tests/project/settings.py +++ b/tests/project/settings.py @@ -1,13 +1,21 @@ +import contextlib + from django.conf.global_settings import * # noqa: F401, F403 from django.contrib.messages import constants as message_constants # Settings deleted to prevent RemovedInDjango 5.0 warnings -del CSRF_COOKIE_MASKED -del DEFAULT_FILE_STORAGE -del USE_L10N -del PASSWORD_RESET_TIMEOUT # pyright: ignore[reportUndefinedVariable] -del STATICFILES_STORAGE -del USE_DEPRECATED_PYTZ +REMOVED_SETTINGS = [ + "CSRF_COOKIE_MASKED", + "DEFAULT_FILE_STORAGE", + "FORMS_URLFIELD_ASSUME_HTTPS", + "PASSWORD_RESET_TIMEOUT", + "STATICFILES_STORAGE", + "USE_DEPRECATED_PYTZ", + "USE_L10N", +] +for setting in REMOVED_SETTINGS: + with contextlib.suppress(NameError): + del globals()[setting] DEBUG = False TEMPLATE_DEBUG = DEBUG