Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update testing to Django 5.0, Python 3.12 #10

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 27 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,38 @@ jobs:
tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest

strategy:
matrix:
DJANGO_VERSION: ['3.1.*', '3.2.*', '4.0.*', '4.1.*']
python-version: ['3.7', '3.8', '3.9', '3.10']
DJANGO_VERSION: ['3.2.*', '4.0.*', '4.1.*', '4.2.*', '5.0.*']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- DJANGO_VERSION: '4.1.*'
- DJANGO_VERSION: '3.2.*'
python-version: '3.11'
- DJANGO_VERSION: '3.2.*'
python-version: '3.12'

- DJANGO_VERSION: '4.0.*'
python-version: '3.7'
- DJANGO_VERSION: '4.0.*'
python-version: '3.11'
- DJANGO_VERSION: '4.0.*'
python-version: '3.12'

- DJANGO_VERSION: '4.1.*'
python-version: '3.7'
- DJANGO_VERSION: '3.1.*'
python-version: '3.10'
- DJANGO_VERSION: '2.2.*'
python-version: '3.10'
- DJANGO_VERSION: '4.1.*'
python-version: '3.12'

- DJANGO_VERSION: '4.2.*'
python-version: '3.7'

- DJANGO_VERSION: '5.0.*'
python-version: '3.7'
- DJANGO_VERSION: '5.0.*'
python-version: '3.8'
- DJANGO_VERSION: '5.0.*'
python-version: '3.9'
fail-fast: false

services:
Expand All @@ -50,7 +68,7 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion plans_payments/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ def change_payment_status(sender, *args, **kwargs):
):
order.status = Order.STATUS.CANCELED
# In case django-simples-history is installed
order._change_reason = f"Django-plans-payments: Payment status changed to {payment.status}"
order._change_reason = (
f"Django-plans-payments: Payment status changed to {payment.status}"
)
order.save()
if hasattr(order.user.userplan, "recurring"):
order.user.userplan.recurring.token_verified = False
Expand Down
5 changes: 5 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- coding: utf-8
from typing import Dict, Tuple

import django

DEBUG = True
USE_TZ = True

Expand Down Expand Up @@ -74,3 +76,6 @@
PLANS_TAX_COUNTRY = "CZ"
PLANS_DEFAULT_COUNTRY = "CZ"
PLANS_GET_COUNTRY_FROM_IP = True

if django.VERSION >= (4, 1):
FORM_RENDERER = "django.forms.renderers.DjangoDivFormRenderer"
22 changes: 15 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
[tox]
envlist =
py{310,39,38}
py{310,39,38}-dj{40,41},
py{312,311,310}-dj50,
py{312,311,310,39,38}-dj42,
py{311,310,39,38}-dj41,
py{310,39,38}-dj40,
py{310,39,38,37,36}-dj32,
py{39,38,37,36}-dj{30,31},
py{38,37,36,35}-dj{20,21,22},
py{39,38,37,36}-dj31,

[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/plans_payments
commands =
python --version
python manage.py --version
python -W error::DeprecationWarning -m coverage run manage.py test
deps =
django-31: Django>=3.1,<3.2
django-32: Django>=3.2,<3.3
django-40: Django>=4.0,<4.1
django-41: Django>=4.1,<4.2
-r{toxinidir}/requirements_test.txt
dj31: Django>=3.1,<3.2
dj32: Django>=3.2,<3.3
dj40: Django>=4.0,<4.1
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<5.0
dj50: Django>=5.0,<5.1
basepython =
py37: python3.7
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12