diff --git a/README.rst b/README.rst index dbdb0e0..c0e8670 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ Add the following to your ``INSTALLED_APPS``: ... 'mjml', 'birdsong', - 'wagtail.contrib.modeladmin', + 'wagtail_modeladmin', ... ] diff --git a/birdsong/options.py b/birdsong/options.py index 346aef3..ae4ff8d 100644 --- a/birdsong/options.py +++ b/birdsong/options.py @@ -5,8 +5,8 @@ from django.urls import re_path from django.utils.module_loading import import_string from django.utils.translation import gettext as _ from django.utils.translation import pgettext -from wagtail.contrib.modeladmin.helpers import AdminURLHelper, ButtonHelper -from wagtail.contrib.modeladmin.options import ModelAdmin +from wagtail_modeladmin.helpers import AdminURLHelper, ButtonHelper +from wagtail_modeladmin.options import ModelAdmin from birdsong.conf import BIRDSONG_TEST_CONTACT diff --git a/birdsong/views/actions.py b/birdsong/views/actions.py index ce83603..10bc26e 100644 --- a/birdsong/views/actions.py +++ b/birdsong/views/actions.py @@ -1,7 +1,7 @@ from django.contrib import messages from django.shortcuts import redirect from django.utils.translation import gettext as _ -from wagtail.contrib.modeladmin.helpers.url import AdminURLHelper +from wagtail_modeladmin.helpers.url import AdminURLHelper from birdsong.models import CampaignStatus diff --git a/birdsong/views/editor.py b/birdsong/views/editor.py index a6bdf39..e388318 100644 --- a/birdsong/views/editor.py +++ b/birdsong/views/editor.py @@ -1,7 +1,7 @@ from django.http.response import JsonResponse from django.shortcuts import render from django.template.loader import render_to_string -from wagtail.contrib.modeladmin.views import CreateView, EditView, InspectView +from wagtail_modeladmin.views import CreateView, EditView, InspectView from birdsong.conf import BIRDSONG_TEST_CONTACT diff --git a/birdsong/wagtail_hooks.py b/birdsong/wagtail_hooks.py index 8fefea6..a5d72e1 100644 --- a/birdsong/wagtail_hooks.py +++ b/birdsong/wagtail_hooks.py @@ -1,4 +1,4 @@ -from wagtail.contrib.modeladmin.options import (ModelAdmin, ModelAdminGroup, +from wagtail_modeladmin.options import (ModelAdmin, ModelAdminGroup, hooks, modeladmin_register) from birdsong.conf import BIRDSONG_ADMIN_GROUP @@ -73,10 +73,10 @@ def modeladmin_re_register(modeladmin_class): menu_icon = "mail" :param modeladmin_class: ModelAdmin class to re-register - :type modeladmin_class: class:`wagtail.contrib.modeladmin.options.ModelAdminGroup` + :type modeladmin_class: class:`wagtail_modeladmin.options.ModelAdminGroup` :return: Re-registered ModelAdmin class - :rtype: class:class:`wagtail.contrib.modeladmin.options.ModelAdminGroup` + :rtype: class:class:`wagtail_modeladmin.options.ModelAdminGroup` """ @hooks.register("construct_main_menu") diff --git a/setup.py b/setup.py index 4a2db85..c67af75 100755 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ setup( author_email="developers@neonjungle.studio", install_requires=[ "wagtail>=4.1", + "wagtail-modeladmin", "django-mjml", ], setup_requires=["wheel"], diff --git a/tests/app/settings.py b/tests/app/settings.py index 1f677ee..aeb2466 100644 --- a/tests/app/settings.py +++ b/tests/app/settings.py @@ -15,7 +15,7 @@ INSTALLED_APPS = [ 'wagtail.snippets', 'wagtail.images', 'wagtail.documents', - 'wagtail.contrib.modeladmin', + 'wagtail_modeladmin', 'django.contrib.admin', 'django.contrib.auth', diff --git a/tests/test_admin.py b/tests/test_admin.py index 4d8c0d2..96a4ae5 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -33,7 +33,7 @@ class TestCampaignAdmin(WagtailTestUtils, TestCase): response = self.client.post( "/admin/app/salecampaign/create/", self.post_data(), follow=True ) - self.assertEquals(response.status_code, 200) + self.assertEqual(response.status_code, 200) def test_edit(self): response = self.client.post( @@ -41,14 +41,14 @@ class TestCampaignAdmin(WagtailTestUtils, TestCase): self.post_data(overrides={"name": "A Different Name"}), follow=True, ) - self.assertEquals(response.status_code, 200) + self.assertEqual(response.status_code, 200) self.assertContains(response, "A Different Name") def test_preview(self): response = self.client.get( f"/admin/app/salecampaign/preview/{self.campaign.id}/", ) - self.assertEquals(response.status_code, 200) + self.assertEqual(response.status_code, 200) self.assertContains(response, "
The body
") def test_live_preview(self): @@ -94,8 +94,8 @@ class TestSending(WagtailTestUtils, TransactionTestCase): self.client.get(f"/admin/app/salecampaign/send_campaign/{self.campaign.id}/") sleep(10) # Allow time to send - self.assertEquals(len(mail.outbox), 2) - self.assertEquals(self.campaign.receipts.all().count(), 2) + self.assertEqual(len(mail.outbox), 2) + self.assertEqual(self.campaign.receipts.all().count(), 2) # Get fresh from db (altered in a thread) fresh_campaign = SaleCampaign.objects.get(pk=self.campaign.pk) - self.assertEquals(fresh_campaign.status, CampaignStatus.SENT) + self.assertEqual(fresh_campaign.status, CampaignStatus.SENT)