From d87c0fd50b189a6766ad1f64e18a50c96862b3ca Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Mon, 13 Nov 2023 16:17:15 +0100 Subject: [PATCH] ci: run tests also with Python 3.12 The `assertEquals` unittest alias has been deprecated in 3.2 and removed in 3.12, so we change it to `assertEqual`. Closes: #411 --- .github/workflows/django-tests.yml | 2 +- apis_core/apis_metainfo/test_models.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/django-tests.yml b/.github/workflows/django-tests.yml index 173036f8f..e1c063db2 100644 --- a/.github/workflows/django-tests.yml +++ b/.github/workflows/django-tests.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11"] + python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/apis_core/apis_metainfo/test_models.py b/apis_core/apis_metainfo/test_models.py index fc462fef8..1e56c78ce 100644 --- a/apis_core/apis_metainfo/test_models.py +++ b/apis_core/apis_metainfo/test_models.py @@ -14,9 +14,9 @@ def setUp(cls): def test_root_object(self): rfoo = RootObject.objects.get(name="foo") rnone = RootObject.objects.get(name="") - self.assertEquals(str(rfoo), "foo") - self.assertEquals(str(rnone), "no name provided") + self.assertEqual(str(rfoo), "foo") + self.assertEqual(str(rnone), "no name provided") def test_uri(self): ufoo = Uri.objects.create() - self.assertEquals(str(ufoo), "None") + self.assertEqual(str(ufoo), "None")