kopia lustrzana https://github.com/wagtail/wagtail
Add header icon support in PageListingViewSet index view
rodzic
53a3705bbb
commit
cfc3c48246
|
@ -2,7 +2,7 @@
|
|||
{% load wagtailadmin_tags i18n %}
|
||||
|
||||
{% block header %}
|
||||
{% include 'wagtailadmin/shared/headers/slim_header.html' with title=header_title search_url=index_results_url buttons=header_buttons %}
|
||||
{% include 'wagtailadmin/shared/headers/slim_header.html' with title=header_title icon_name=header_icon search_url=index_results_url buttons=header_buttons %}
|
||||
{% endblock %}
|
||||
|
||||
{% block listing %}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from django.test import TestCase
|
||||
|
||||
from wagtail.test.utils import WagtailTestUtils
|
||||
from wagtail.test.utils.template_tests import AdminTemplateTestUtils
|
||||
|
||||
|
||||
class TestCustomListing(TestCase, WagtailTestUtils):
|
||||
class TestCustomListing(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
|
||||
fixtures = ["test.json"]
|
||||
|
||||
def test_get(self):
|
||||
|
@ -15,6 +16,16 @@ class TestCustomListing(TestCase, WagtailTestUtils):
|
|||
self.assertContains(response, "Christmas")
|
||||
self.assertContains(response, "Saint Patrick")
|
||||
self.assertNotContains(response, "Welcome to the Wagtail test site!")
|
||||
self.assertBreadcrumbsItemsRendered(
|
||||
[{"url": "", "label": "Event pages"}],
|
||||
response.content,
|
||||
)
|
||||
soup = self.get_soup(response.content)
|
||||
breadcrumbs_icon = soup.select_one(".w-breadcrumbs__icon")
|
||||
self.assertIsNotNone(breadcrumbs_icon)
|
||||
use = breadcrumbs_icon.select_one("use")
|
||||
self.assertIsNotNone(use)
|
||||
self.assertEqual(use["href"], "#icon-calendar")
|
||||
|
||||
def test_filter(self):
|
||||
self.login()
|
||||
|
|
Ładowanie…
Reference in New Issue