Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wagtail 4.1.9 upgrade #1522

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 2 additions & 5 deletions allies/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from allies.models import AllySubject, Ally
from snippets.models import Subject

from wagtail.test.utils import WagtailTestUtils, WagtailPageTests
from wagtail.test.utils import WagtailTestUtils, WagtailPageTestCase


class AlliesTests(WagtailPageTests):
class AlliesTests(WagtailPageTestCase):
def setUp(self):
self.math = Subject(name="Math", page_content="Math page content.", seo_title="Math SEO Title",
search_description="Math page description.")
Expand Down Expand Up @@ -42,8 +42,5 @@ def test_can_create_ally_subject(self):
self.assertEquals('Math', result.get_subject_name())

def test_can_create_ally(self):
#ally_subject = AllySubject(subject=self.math, ally=self.ally)
#ally_subject.save()
result = Ally.objects.all()[0]
#print('ally subject: ' + str(result))
self.assertEquals('Ally Heading', result.heading)
4 changes: 2 additions & 2 deletions books/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import vcr

from wagtail.test.utils import WagtailPageTests
from wagtail.test.utils import WagtailPageTestCase
from wagtail.models import Page

import snippets.models
Expand All @@ -14,7 +14,7 @@
import datetime


class BookTests(WagtailPageTests):
class BookTests(WagtailPageTestCase):

def setUp(self):
self.client = Client()
Expand Down
6 changes: 3 additions & 3 deletions news/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from django.utils import timezone
from django.test import TestCase
from wagtail.test.utils import WagtailPageTests
from wagtail.test.utils import WagtailPageTestCase
from wagtail.models import Page
from pages.models import HomePage
from shared.test_utilities import assertPathDoesNotRedirectToTrailingSlash
Expand All @@ -12,7 +12,7 @@
from snippets.models import Subject, BlogContentType, BlogCollection


class NewsTests(WagtailPageTests, TestCase):
class NewsTests(WagtailPageTestCase, TestCase):
def setUp(self):
# create collections
self.learning = BlogCollection(name='Teaching and Learning', description='this is a collection')
Expand Down Expand Up @@ -258,7 +258,7 @@ def test_search_blog_collection_and_two_subjects(self):
self.assertContains(response, 'Math')


class PressTests(WagtailPageTests):
class PressTests(WagtailPageTestCase):
def setUp(self):
press_index = PressIndex.objects.all()[0]
self.press_release = PressRelease(title='Press release',
Expand Down
4 changes: 2 additions & 2 deletions oxmenus/tests.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json

from django.test import TestCase
from wagtail.test.utils import WagtailPageTests
from wagtail.test.utils import WagtailPageTestCase
from oxmenus.models import Menus


class OXMenuTests(WagtailPageTests, TestCase):
class OXMenuTests(WagtailPageTestCase, TestCase):
def setUp(self):
oxmenu = Menus(name="What we do",
menu=json.dumps(
Expand Down
12 changes: 6 additions & 6 deletions pages/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from django.test import TestCase, Client
from django.core.management import call_command
from wagtail.test.utils import WagtailTestUtils, WagtailPageTests
from wagtail.test.utils import WagtailTestUtils, WagtailPageTestCase
from wagtail.models import Page
from pages.models import (HomePage,
ContactUs,
Expand Down Expand Up @@ -44,7 +44,7 @@
from shared.test_utilities import assertPathDoesNotRedirectToTrailingSlash, mock_user_login
from http import cookies

class HomePageTests(WagtailPageTests):
class HomePageTests(WagtailPageTestCase):

def setUp(self):
mock_user_login()
Expand Down Expand Up @@ -105,7 +105,7 @@ def test_allowed_subpages(self):
Assignable,
})

class PageTests(WagtailPageTests):
class PageTests(WagtailPageTestCase):
def setUp(self):
mock_user_login()
root_page = Page.objects.get(title="Root")
Expand Down Expand Up @@ -496,7 +496,7 @@ def test_can_create_assignable_page(self):
self.assertEqual(retrieved_page.title, "Assignable Page")


class ErrataListTest(WagtailPageTests):
class ErrataListTest(WagtailPageTestCase):

def setUp(self):
mock_user_login()
Expand All @@ -521,7 +521,7 @@ def test_can_create_errata_list_page(self):
self.assertEqual(retrieved_page.title, "Errata List Template")


class SubjectsPageTest(WagtailPageTests):
class SubjectsPageTest(WagtailPageTestCase):

def setUp(self):
mock_user_login()
Expand All @@ -543,7 +543,7 @@ def test_can_create_subjects_page(self):
self.assertEqual(retrieved_page.title, "Subjects")


class SubjectPageTest(WagtailPageTests):
class SubjectPageTest(WagtailPageTestCase):

def setUp(self):
mock_user_login()
Expand Down
7 changes: 4 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ django-import-export==2.8.0
django-libsass==0.9
django-rest-auth==0.9.5
django-reversion==5.0.0
djangorestframework==3.14.0
django-ses==3.0.1
django-storages==1.12.3
django-taggit>=3.0.0
django-taggit>=3.1.0
future==0.18.2
html2text==2020.1.16 # used in news feed
jsonfield==3.1.0
mapbox==0.18.1
MarkupPy==1.14
odfpy==1.4.1
openpyxl==3.0.10
psycopg2>=2.9.5
psycopg2>=2.9.9
pycryptodome==3.14.1 # for using the SSO cookie from accounts
PyJWE==1.0.0
sentry-sdk
Expand All @@ -30,7 +31,7 @@ ua_parser==0.16.1
unicodecsv==0.14.1
Unidecode==1.3.4
vcrpy==4.1.1 # for recording test interactions with third-party APIs
wagtail==4.0.4
wagtail==4.1.9
Wand==0.6.7 # for supporting animated gifs
whitenoise==6.1.0
xlrd==2.0.1
Expand Down
4 changes: 2 additions & 2 deletions salesforce/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from rest_framework.test import APITestCase
from rest_framework.test import APIRequestFactory

from wagtail.test.utils import WagtailPageTests
from wagtail.test.utils import WagtailPageTestCase
from wagtail.models import Page
from wagtail.documents.models import Document

Expand Down Expand Up @@ -103,7 +103,7 @@ def test_all_partners_no_reviews(self):
# self.assertEqual(response.data['status'], 'Deleted')


class SalesforceTest(LiveServerTestCase, WagtailPageTests):
class SalesforceTest(LiveServerTestCase, WagtailPageTestCase):

def setUp(self):
mock_user_login()
Expand Down
14 changes: 14 additions & 0 deletions snippets/migrations/0031_merge_20231101_1313.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 4.1.7 on 2023-11-01 18:13

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('snippets', '0030_alter_erratacontent_book_state'),
('snippets', '0030_amazonbookblurb'),
]

operations = [
]
4 changes: 2 additions & 2 deletions webinars/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from django.test import TestCase
from django.utils import timezone
from wagtail.test.utils import WagtailPageTests
from wagtail.test.utils import WagtailPageTestCase

from snippets.models import Subject, WebinarCollection
from webinars.models import Webinar


class WebinarTests(WagtailPageTests, TestCase):
class WebinarTests(WagtailPageTestCase, TestCase):
def setUp(self):
# create subjects
self.math = Subject(name="Math", page_content="Math page content.", seo_title="Math SEO Title",
Expand Down