Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

services:
postgres:
image: postgres:16
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -34,7 +34,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install tox requests
Expand All @@ -44,7 +44,7 @@ jobs:
env:
DATABASE_URL: postgres://postgres:postgres@localhost/wagtail_ab_testing
run: |
tox -e wagtailmain-postgres,wagtailmain-sqlite
tox -e future-postgres,future-sqlite

- name: Send Slack notification on failure
if: steps.test.outcome == 'failure'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
test_python:
services:
postgres:
image: postgres:16
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -67,12 +67,12 @@ jobs:
experimental: [false]
toxenv: ['py']
include:
# Future Wagtail release from main branch (allowed to fail)
# Future Wagtail and Django versions from main branch (allowed to fail)
- python: '3.13'
toxenv: wagtailmain-sqlite
toxenv: future-sqlite
experimental: true
- python: '3.13'
toxenv: wagtailmain-postgres
toxenv: future-postgres
experimental: true
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.13] - UNRELEASED

- Nothing new yet
- [Drop support for Wagtail 5.2, 6.0, 6.1, and 6.2](https://github.com/wagtail-nest/wagtail-ab-testing/pull/99)

## [0.12] - 2025-04-25

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Key features:

## Usage

Wagtail A/B Testing works with Django 4.2+, Wagtail 5.2+ on Python 3.9+ environments.
Wagtail A/B Testing works with Django 4.2+, Wagtail 6.3+ on Python 3.9+ environments.

### Creating an A/B test

Expand Down
8 changes: 3 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[tox]
envlist =
; Django 4.2 LTS is the only version still supported under Wagtail 5.2
py{39,310,311,312}-django42-wagtail52-{sqlite,postgres}
py{39,310,311,312}-django42-wagtail{63,64,70}-{sqlite,postgres}
py{310,311,312,313}-django51-wagtail{63,64,70}-{sqlite,postgres}
; 6.3 LTS and 7.0 are the only versions to support Django 5.2 as of now
Expand All @@ -20,9 +18,8 @@ basepython =
deps =
coverage
django42: django>=4.2,<5
django51: django>=5.1,<5.2
django52: django>=5.2,<5.3

wagtail52: wagtail~=5.2.0
wagtail63: wagtail~=6.3.0
wagtail64: wagtail~=6.4.0
wagtail70: wagtail>=7.0.0,<7.1
Expand All @@ -33,11 +30,12 @@ extras = testing
setenv =
postgres: DATABASE_URL={env:DATABASE_URL:postgres:///wagtail_ab_testing}

[testenv:wagtailmain]
[testenv:future]
allowlist_externals = coverage
deps =
coverage
git+https://github.com/wagtail/wagtail.git@main#egg=Wagtail
git+https://github.com/django/django.git@main#egg=Django
extras = testing
setenv =
postgres: DATABASE_URL={env:DATABASE_URL:postgres:///wagtail_ab_testing}

This file was deleted.

8 changes: 1 addition & 7 deletions wagtail_ab_testing/test/tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django.urls import reverse
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail.models import Page
from wagtail.test.utils import WagtailTestUtils

Expand Down Expand Up @@ -41,9 +40,4 @@ def setUp(self):

def test_get_report(self):
response = self.client.get(reverse("wagtail_ab_testing_admin:report"))

# TODO: compatibility: remove this check when dropping support for < 6.2
if WAGTAIL_VERSION < (6, 2):
self.assertTemplateUsed(response, "wagtail_ab_testing/_compat/report.html")
else:
self.assertTemplateUsed(response, "wagtail_ab_testing/report.html")
self.assertTemplateUsed(response, "wagtail_ab_testing/report.html")
21 changes: 1 addition & 20 deletions wagtail_ab_testing/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
permission_classes,
)
from rest_framework.response import Response
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail.admin import messages, panels
from wagtail.admin.action_menu import ActionMenuItem
from wagtail.admin.filters import DateRangePickerWidget, WagtailFilterSet
Expand Down Expand Up @@ -621,32 +620,14 @@ class Meta:


class AbTestingReportView(ReportView):
title = gettext_lazy("A/B testing")
page_title = gettext_lazy("A/B testing")
index_results_url_name = "wagtail_ab_testing_admin:report_results"
index_url_name = "wagtail_ab_testing_admin:report"
results_template_name = "wagtail_ab_testing/report.html"
header_icon = "people-arrows"

filterset_class = AbTestingReportFilterSet

@property
def template_name(self):
# Upgrade consideration: https://docs.wagtail.org/en/stable/releases/6.2.html#adjust-the-templates
# TODO: compatibility: remove `template_name` getter once Wagtail 6.2
# is the minimum supported version

# If we are on Wagtail 6.1 or below, we need to provide the 'old'-style report template
if WAGTAIL_VERSION < (6, 2):
return "wagtail_ab_testing/_compat/report.html"

return ReportView.template_name

@property
# TODO: compatibility: replace `title` attribute with `page_title` and
# delete this getter once Wagtail 6.2 is the minimum supported version
def page_title(self):
return self.title

def get_queryset(self):
return AbTest.objects.all().order_by(
F("first_started_at").desc(nulls_first=True)
Expand Down