diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b2aabd..e4a59f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,18 +3,17 @@ jobs: build: working_directory: ~/wagtailquickcreate docker: - - image: circleci/python:3.8.0 + - image: cimg/python:3.12.1 environment: PIPENV_VENV_IN_PROJECT: true DATABASE_URL: postgresql://root@localhost/circle_test?sslmode=disable - - image: circleci/postgres:9.6.2 + - image: cimg/postgres:16.2 environment: POSTGRES_USER: root POSTGRES_DB: circle_test steps: - checkout - - run: sudo chown -R circleci:circleci /usr/local/bin - - run: sudo chown -R circleci:circleci /usr/local/lib/python3.8/site-packages + - run: sudo apt-get update && sudo apt-get install -y python3-pip - run: command: | sudo pip install pipenv diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3ed743c..028f104 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,11 +12,11 @@ jobs: strategy: matrix: include: - - python: 3.9 - wagtail: wagtail>=4.1 + - python: 3.12 + wagtail: wagtail>=5.2 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: "pip" diff --git a/setup.py b/setup.py index 198e4d2..dd147f4 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ packages=find_packages(exclude=['tests*']), include_package_data=True, install_requires=[ - 'wagtail>=4.1', + 'wagtail>=5.2', ], classifiers=[ 'Environment :: Web Environment', @@ -40,7 +40,7 @@ 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Framework :: Wagtail', - 'Framework :: Wagtail :: 4', 'Framework :: Wagtail :: 5', + 'Framework :: Wagtail :: 6', ], ) diff --git a/wagtailquickcreate/templates/wagtailquickcreate/create.html b/wagtailquickcreate/templates/wagtailquickcreate/create.html index f85f027..d8dd0ee 100644 --- a/wagtailquickcreate/templates/wagtailquickcreate/create.html +++ b/wagtailquickcreate/templates/wagtailquickcreate/create.html @@ -6,13 +6,15 @@ {% block content %}
-
-
-

- - Add {{ model_verbose_name }} -

-

{{ user.get_full_name|default:user.get_username }}

+
+
+
+

+
+ Add {{ model_verbose_name }} + {{ user.get_full_name|default:user.get_username }} +

+
@@ -28,7 +30,8 @@

{{ user.get_full_name|default:user.get_username }}

{% for page in parent_pages %}
  • - + + {% icon name="plus-inverse" classname="default w-mr-1 w-align-middle" %} {% for parent in page.ancestors %} {% if not parent.is_root %} {{ parent }} > diff --git a/wagtailquickcreate/tests/tests.py b/wagtailquickcreate/tests/tests.py index d6ea872..326b12c 100644 --- a/wagtailquickcreate/tests/tests.py +++ b/wagtailquickcreate/tests/tests.py @@ -8,39 +8,53 @@ class WagtailQuickCreateTests(TestCase, WagtailTestUtils): - fixtures = ['wagtailquickcreate/tests/fixtures/test.json'] + fixtures = ["wagtailquickcreate/tests/fixtures/test.json"] def setUp(self): super().setUp() self.login() self.home = Page.objects.get(pk=2) - self.index = IndexPage( - title='Section 1', - slug='section-1', - introduction='...' - ) + self.index = IndexPage(title="Section 1", slug="section-1", introduction="...") self.index_2 = IndexPage( - title='Section 2', - slug='section-2', - introduction='...' + title="Section 2", slug="section-2", introduction="..." ) self.home.add_child(instance=self.index) self.index.add_child(instance=self.index_2) def test_admin(self): - response = self.client.get(reverse('wagtailadmin_home')) + response = self.client.get(reverse("wagtailadmin_home")) self.assertEqual(response.status_code, 200) def test_quickcreate_panel_links(self): - response = self.client.get('/admin/') - self.assertTrue('Add Image' in str(response.content)) - self.assertTrue('Add Document' in str(response.content)) - self.assertTrue('Add Information page' in str(response.content)) + response = self.client.get("/admin/") + self.assertTrue("Add Image" in str(response.content)) + self.assertTrue("Add Document" in str(response.content)) + self.assertTrue("Add Information page" in str(response.content)) def test_first_level_index_page_in_shortcut_view(self): - response = self.client.get('/admin/quickcreate/create/standardpages/informationpage/') - self.assertContains(response, 'Home > Section 1', html=True) + response = self.client.get( + "/admin/quickcreate/create/standardpages/informationpage/" + ) + self.assertContains( + response, + "Home >\n " + "\n " + "\n " + "Section 1", + ) def test_second_level_index_in_shortcut_view(self): - response = self.client.get('/admin/quickcreate/create/standardpages/informationpage/') - self.assertContains(response, 'Home > Section 1 > Section 2', html=True) + response = self.client.get( + "/admin/quickcreate/create/standardpages/informationpage/" + ) + self.assertContains( + response, + "Home >\n " + "\n " + "\n " + "\n " + "Section 1 >\n " + "\n " + "\n " + "Section 2", + )