Skip to content

Commit

Permalink
Merge pull request #702 from drnlm/feature/update_ci
Browse files Browse the repository at this point in the history
Feature/update ci
  • Loading branch information
drnlm authored Mar 4, 2024
2 parents 5aada61 + b0218e1 commit 032bae0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 41 deletions.
69 changes: 33 additions & 36 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,46 +26,41 @@ 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
continue-on-error: ${{ matrix.django-version == 'main' }}
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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
17 changes: 12 additions & 5 deletions wafer/schedule/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit 032bae0

Please sign in to comment.