Update to Wagtail 5.2 (and others)

This commit is contained in:
Jake Howard 2024-01-05 15:30:31 +00:00
parent 53479eeea9
commit 48e36bc5b9
Signed by: jake
GPG key ID: 57AFB45680EDD477
7 changed files with 22 additions and 22 deletions

View file

@ -6,7 +6,7 @@ django-browser-reload==1.11.0
django-debug-toolbar django-debug-toolbar
types-requests==2.31.0.1 types-requests==2.31.0.1
mypy==1.5.1 mypy==1.5.1
wagtail-factories==4.0.0 wagtail-factories==4.1.0
coverage==7.3.0 coverage==7.3.0
djlint==1.31.0 djlint==1.31.0
types-pyyaml==6.0.12.9 types-pyyaml==6.0.12.9

View file

@ -1,25 +1,25 @@
Django==3.2.22 Django==5.0.1
wagtail==4.1.8 wagtail==5.2.2
django-environ==0.11.2 django-environ==0.11.2
whitenoise[brotli]==6.5.0 whitenoise[brotli]==6.5.0
Pygments==2.16.1 Pygments==2.16.1
beautifulsoup4==4.11.2 beautifulsoup4==4.11.2
lxml==4.9.1 lxml==4.9.1
requests==2.31.0 requests==2.31.0
wagtail-generic-chooser==0.5.1 wagtail-generic-chooser==0.6
django-rq==2.8.0 django-rq==2.8.0
django-redis==5.3.0 django-redis==5.3.0
gunicorn==21.2.0 gunicorn==21.2.0
psycopg2==2.9.6 psycopg2==2.9.6
djangorestframework djangorestframework
django-htmx==1.16.0 django-htmx==1.16.0
wagtail-metadata==4.0.3 wagtail-metadata==5.0.0
django-plausible==0.5.0 django-plausible==0.5.0
sentry-sdk==1.29.2 sentry-sdk==1.29.2
django-sri==0.7.0 django-sri==0.7.0
wagtail-2fa==1.6.5 wagtail-2fa==1.6.9
django-health-check==3.17.0 django-health-check==3.17.0
wagtail-autocomplete==0.10.0 wagtail-autocomplete==0.11.0
Wand==0.6.11 Wand==0.6.11
django3-cache-decorator==0.5.2 django3-cache-decorator==0.5.2
django-cors-headers==4.2.0 django-cors-headers==4.2.0
@ -34,7 +34,7 @@ uritemplate
PyYAML PyYAML
# Use custom `wagtail-favicon` with performance improvements # Use custom `wagtail-favicon` with performance improvements
git+https://github.com/RealOrangeOne/wagtail-favicon@4586efaac746085338fc7d61713006d9adc62d2e git+https://github.com/RealOrangeOne/wagtail-favicon@b892165e047b35c46d7244109b9ad9226d32a213
# Use custom `wagtail-draftail-snippet` with support for Wagtail 4.1 # Use custom `wagtail-draftail-snippet` with support for Wagtail 5.x
git+https://github.com/RealOrangeOne/wagtail-draftail-snippet@0924ab12b1ca205b94ccd9a34ecc446d7ac422e5 git+https://github.com/aaronhaslett/wagtail-draftail-snippet@347cf41b29e0aa1ef43b53632ef29f07967a19e1

View file

@ -18,7 +18,7 @@ class BlogPostPageTestCase(TestCase):
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
def test_queries(self) -> None: def test_queries(self) -> None:
with self.assertNumQueries(48): with self.assertNumQueries(41):
self.client.get(self.page.url) self.client.get(self.page.url)
@ -76,7 +76,7 @@ class BlogPostListPageTestCase(TestCase):
self.assertEqual(len(response.context["listing_pages"]), 2) self.assertEqual(len(response.context["listing_pages"]), 2)
def test_queries(self) -> None: def test_queries(self) -> None:
with self.assertNumQueries(44): with self.assertNumQueries(37):
self.client.get(self.page.url) self.client.get(self.page.url)
def test_feed_accessible(self) -> None: def test_feed_accessible(self) -> None:

View file

@ -36,7 +36,7 @@ class ContentPageTestCase(TestCase):
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
def test_queries(self) -> None: def test_queries(self) -> None:
with self.assertNumQueries(39): with self.assertNumQueries(32):
self.client.get(self.page.url) self.client.get(self.page.url)
@ -53,7 +53,7 @@ class ListingPageTestCase(TestCase):
ContentPageFactory(parent=cls.page) ContentPageFactory(parent=cls.page)
def test_accessible(self) -> None: def test_accessible(self) -> None:
with self.assertNumQueries(42): with self.assertNumQueries(35):
response = self.client.get(self.page.url) response = self.client.get(self.page.url)
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.context["listing_pages"]), 2) self.assertEqual(len(response.context["listing_pages"]), 2)

View file

@ -22,7 +22,7 @@ class Error404PageTestCase(TestCase):
) )
def test_queries(self) -> None: def test_queries(self) -> None:
with self.assertNumQueries(22): with self.assertNumQueries(16):
self.client.get(self.url) self.client.get(self.url)

View file

@ -3,11 +3,11 @@ from typing import Type
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.http.response import Http404 from django.http.response import Http404
from django.utils.html import format_html from django.utils.html import format_html
from wagtail import hooks
from wagtail.admin.forms.models import WagtailAdminModelForm from wagtail.admin.forms.models import WagtailAdminModelForm
from wagtail.contrib.modeladmin.helpers import WagtailBackendSearchHandler from wagtail.contrib.modeladmin.helpers import WagtailBackendSearchHandler
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail.contrib.modeladmin.views import CreateView, EditView, IndexView from wagtail.contrib.modeladmin.views import CreateView, EditView, IndexView
from wagtail.core import hooks
from .models import UnsplashPhoto from .models import UnsplashPhoto
from .utils import get_unsplash_photo from .utils import get_unsplash_photo

View file

@ -56,7 +56,7 @@ class SearchPageResultsTestCase(TestCase):
cls.url = cls.page.url + cls.page.reverse_subpage("results") cls.url = cls.page.url + cls.page.reverse_subpage("results")
def test_returns_results(self) -> None: def test_returns_results(self) -> None:
with self.assertNumQueries(24): with self.assertNumQueries(23):
response = self.client.get(self.url, {"q": "post"}, HTTP_HX_REQUEST="true") response = self.client.get(self.url, {"q": "post"}, HTTP_HX_REQUEST="true")
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
@ -90,7 +90,7 @@ class SearchPageResultsTestCase(TestCase):
) )
def test_too_high_page(self) -> None: def test_too_high_page(self) -> None:
with self.assertNumQueries(49): with self.assertNumQueries(42):
response = self.client.get( response = self.client.get(
self.url, {"q": "post", "page": 30}, HTTP_HX_REQUEST="true" self.url, {"q": "post", "page": 30}, HTTP_HX_REQUEST="true"
) )
@ -111,21 +111,21 @@ class SearchPageResultsTestCase(TestCase):
self.assertContains(response, "No results found") self.assertContains(response, "No results found")
def test_no_query(self) -> None: def test_no_query(self) -> None:
with self.assertNumQueries(7): with self.assertNumQueries(6):
response = self.client.get(self.url, HTTP_HX_REQUEST="true") response = self.client.get(self.url, HTTP_HX_REQUEST="true")
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "search/enter-search-term.html") self.assertTemplateUsed(response, "search/enter-search-term.html")
def test_empty_query(self) -> None: def test_empty_query(self) -> None:
with self.assertNumQueries(7): with self.assertNumQueries(6):
response = self.client.get(self.url, {"q": ""}, HTTP_HX_REQUEST="true") response = self.client.get(self.url, {"q": ""}, HTTP_HX_REQUEST="true")
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "search/enter-search-term.html") self.assertTemplateUsed(response, "search/enter-search-term.html")
def test_not_htmx(self) -> None: def test_not_htmx(self) -> None:
with self.assertNumQueries(7): with self.assertNumQueries(6):
response = self.client.get(self.url) response = self.client.get(self.url)
self.assertEqual(response.status_code, 400) self.assertEqual(response.status_code, 400)
@ -140,7 +140,7 @@ class OpenSearchTestCase(TestCase):
ContentPageFactory(parent=cls.home_page, title=f"Post {i}") ContentPageFactory(parent=cls.home_page, title=f"Post {i}")
def test_opensearch_description(self) -> None: def test_opensearch_description(self) -> None:
with self.assertNumQueries(11): with self.assertNumQueries(8):
response = self.client.get(reverse("opensearch")) response = self.client.get(reverse("opensearch"))
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)