From 0fcc722a2b6e853fb307acebd5e2710e0def8c40 Mon Sep 17 00:00:00 2001 From: Anders <6058745+ddabble@users.noreply.github.com> Date: Mon, 6 Feb 2023 23:20:30 +0100 Subject: [PATCH 1/3] Set USE_TZ explicitly to fix some failing tests In Django's `main` branch, the default value of the `USE_TZ` setting was changed from `False` to `True` (see https://github.com/django/django/commit/602d9a312facc64d44619c61c3863d3d0820006a), which caused the tests relying on timezone-naive `datetime` objects, to fail. Example of some of the failing tests: https://github.com/jazzband/django-simple-history/actions/runs/4108104757/jobs/7088397467. --- runtests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/runtests.py b/runtests.py index dbed2a0a1..f0e7aa735 100755 --- a/runtests.py +++ b/runtests.py @@ -135,6 +135,7 @@ def __getitem__(self, item): } ], DEFAULT_AUTO_FIELD="django.db.models.AutoField", + USE_TZ=False, ) MIDDLEWARE = [ "django.contrib.sessions.middleware.SessionMiddleware", From c971c14c55924bbdfa65c282df73ff6370143ec9 Mon Sep 17 00:00:00 2001 From: Anders <6058745+ddabble@users.noreply.github.com> Date: Mon, 6 Feb 2023 23:39:02 +0100 Subject: [PATCH 2/3] Exclude testing py38+py39 with djmain ...to fix the remaining failing tests. This is due to Django's `main` branch now requiring Python >=3.10. Example of the errors: https://github.com/jazzband/django-simple-history/actions/runs/4108104757/jobs/7088396098. --- .github/workflows/test.yml | 6 ++++++ tox.ini | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aae220606..d4cf101ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,12 @@ jobs: - python-version: '3.7' django-version: 'main' + - python-version: '3.8' + django-version: 'main' + + - python-version: '3.9' + django-version: 'main' + - python-version: '3.11' django-version: '3.2' - python-version: '3.11' diff --git a/tox.ini b/tox.ini index fa2fb5a45..1d57f75f3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] envlist = py{37,38,39,310}-dj32-{sqlite3,postgres,mysql,mariadb}, - py{38,39,310}-dj{40,41,main}-{sqlite3,postgres,mysql,mariadb}, + py{38,39}-dj{40,41}-{sqlite3,postgres,mysql,mariadb}, + py310-dj{40,41,main}-{sqlite3,postgres,mysql,mariadb}, py311-dj{41,main}-{sqlite3,postgres,mysql,mariadb}, docs, lint From 891174eb18c61bef121b7053c111936f794a0936 Mon Sep 17 00:00:00 2001 From: Anders <6058745+ddabble@users.noreply.github.com> Date: Tue, 7 Feb 2023 00:49:26 +0100 Subject: [PATCH 3/3] Corrected the test workflow badge URLs These URLs were not updated when the `build` workflow was renamed to `test` (in 60beaf4d5157c2512da320e2ee436769a2fa061a). --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 3ede34c7f..495cabb60 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,8 @@ django-simple-history ===================== -.. image:: https://github.com/jazzband/django-simple-history/workflows/build/badge.svg?branch=master - :target: https://github.com/jazzband/django-simple-history/actions?workflow=build +.. image:: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml/badge.svg + :target: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml :alt: Build Status .. image:: https://readthedocs.org/projects/django-simple-history/badge/?version=latest