diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index a088d311..fe6f1f3a 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -26,31 +26,33 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - django-version: ['3.2.0', '4.0.0', '4.1.0', '4.2.0', 'main'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + django-version: ['3.2.0', '4.0.0', '4.1.0', '4.2.0', '5.0.0', 'main'] exclude: - - django-version: '4.0.0' - python-version: '3.7' - - django-version: '4.1.0' - python-version: '3.7' - django-version: '4.2.0' python-version: '3.8' - - django-version: '4.2.0' - python-version: '3.7' - - django-version: 'main' - python-version: '3.7' - django-version: 'main' python-version: '3.8' - django-version: 'main' python-version: '3.9' + - django-version: '5.0.0' + python-version: '3.8' + - django-version: '5.0.0' + python-version: '3.9' - django-version: '3.2.0' python-version: '3.11' - django-version: '4.0.0' python-version: '3.11' + - django-version: '3.2.0' + python-version: '3.12' + - django-version: '4.0.0' + python-version: '3.12' + - django-version: '4.1.0' + python-version: '3.12' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies @@ -58,14 +60,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt -r requirements-dev.txt - - name: 'Install psycopg2 for Django < 3.1' - # Django < 3.1 is incompatible with psycopg2 2.9 - # See https://github.com/psycopg/psycopg2/issues/1293 - if: "matrix.django-version == '2.2.0' || matrix.django-version == '3.0.0'" - run: | - pip install 'psycopg2<2.9' - name: 'Install psycopg2' - if: "matrix.django-version != '2.2.0' && matrix.django-version != '3.0.0'" run: | pip install psycopg2 - name: Install Django Release @@ -93,31 +88,33 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.7', '3.8', '3.9', '3.10','3.11'] - django-version: ['3.2.0', '4.0.0', '4.1.0', '4.2.0', 'main'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + django-version: ['3.2.0', '4.0.0', '4.1.0', '4.2.0', '5.0.0', 'main'] exclude: - - django-version: '4.0.0' - python-version: '3.7' - - django-version: '4.1.0' - python-version: '3.7' - - django-version: '4.2.0' - python-version: '3.7' - django-version: '4.2.0' python-version: '3.8' - - django-version: 'main' - python-version: '3.7' - django-version: 'main' python-version: '3.8' - django-version: 'main' python-version: '3.9' + - django-version: '5.0.0' + python-version: '3.8' + - django-version: '5.0.0' + python-version: '3.9' - django-version: '3.2.0' python-version: '3.11' - django-version: '4.0.0' python-version: '3.11' + - django-version: '3.2.0' + python-version: '3.12' + - django-version: '4.0.0' + python-version: '3.12' + - django-version: '4.1.0' + python-version: '3.12' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies @@ -144,11 +141,11 @@ jobs: runs-on: ubuntu-latest name: Compile Translations steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Install Python Dependencies run: | python -m pip install --upgrade pip @@ -173,9 +170,9 @@ jobs: matrix: browser: ['chrome', 'firefox'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 - name: Install Dependencies run: | python -m pip install --upgrade pip diff --git a/wafer/schedule/tests/test_admin.py b/wafer/schedule/tests/test_admin.py index eafdcba9..6570f925 100644 --- a/wafer/schedule/tests/test_admin.py +++ b/wafer/schedule/tests/test_admin.py @@ -2,7 +2,7 @@ from django.test import TestCase from django.http import HttpRequest -from django.utils import timezone +from django.utils import timezone, version from wafer.pages.models import Page from wafer.schedule.admin import ( @@ -197,16 +197,23 @@ def _make_block_filter(self, block): # We can get away with request None, since SimpleListFilter # doesn't use request in the bits we want to test if block: - return SlotBlockFilter(None, {'block': str(block.pk)}, Slot, self.admin) + value = str(block.pk) else: - return SlotBlockFilter(None, {'block': None}, Slot, self.admin) + value = None + if version.get_complete_version()[0] >= 5: + # Django 5 changes the way filter parameters are handled + value = [value] + return SlotBlockFilter(None, {'block': value}, Slot, self.admin) def _make_time_filter(self, time): """create a list filter for testing.""" if time: - return SlotStartTimeFilter(None, {'start': time}, Slot, self.admin) + value = time else: - return SlotStartTimeFilter(None, {'start': None}, Slot, self.admin) + value = None + if version.get_complete_version()[0] >= 5: + value = [value] + return SlotStartTimeFilter(None, {'start': value}, Slot, self.admin) def test_day_filter_lookups(self): """Test that filter lookups are sane."""