From a059489c66fc8e2faae7b12f6644569fc7a91ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Fri, 12 Apr 2024 10:43:55 +0200 Subject: [PATCH 1/3] fix Black errors --- plans_payments/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plans_payments/models.py b/plans_payments/models.py index 5b18bb7..da2e645 100644 --- a/plans_payments/models.py +++ b/plans_payments/models.py @@ -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 From 020d0764b59f82ec7a510d0daa35a8ea07370218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Thu, 11 Apr 2024 17:05:08 +0200 Subject: [PATCH 2/3] update testing to Django 5.0, Python 3.12 --- .github/workflows/main.yml | 36 +++++++++++++++++++++++++++--------- tox.ini | 22 +++++++++++++++------- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ee40a7..d973158 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -50,7 +68,7 @@ jobs: steps: - uses: actions/checkout@v2 - + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: diff --git a/tox.ini b/tox.ini index 42974c3..452e9f4 100644 --- a/tox.ini +++ b/tox.ini @@ -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 From 747ab7618ee82d6aa7300634c96545583f71ab20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Fri, 12 Apr 2024 13:12:33 +0200 Subject: [PATCH 3/3] fix Django 5.0 deprecation warning --- tests/settings.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/settings.py b/tests/settings.py index bd07f2e..79afeda 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 from typing import Dict, Tuple +import django + DEBUG = True USE_TZ = True @@ -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"