kopia lustrzana https://github.com/wagtail/wagtail
Ensure breadcrumb respects custom get_admin_display_title methods. Fixes #4353
rodzic
f92a890303
commit
626418d348
|
@ -31,6 +31,7 @@ Changelog
|
|||
* Fix: Creating a new object with inlines while mandatory fields are empty no longer crashes (Bertrand Bordage)
|
||||
* Fix: Localization of image and apps verbose names
|
||||
* Fix: Draftail editor no longer crashes after deleting image/embed using DEL key (Thibaud Colas)
|
||||
* Fix: Breadcrumb navigation now respects custom `get_admin_display_title` methods (Arthur Holzner, Wietze Helmantel, Matt Westcott)
|
||||
|
||||
|
||||
2.0.1 (xx.xx.xxxx) - IN DEVELOPMENT
|
||||
|
|
|
@ -287,6 +287,7 @@ Contributors
|
|||
* Alexs Mathilda
|
||||
* Tony Yates
|
||||
* Mike Kamermans
|
||||
* Arthur Holzner
|
||||
|
||||
Translators
|
||||
===========
|
||||
|
|
|
@ -49,6 +49,7 @@ Bug fixes
|
|||
* Creating a new object with inlines while mandatory fields are empty no longer crashes (Bertrand Bordage)
|
||||
* Localization of image and apps verbose names
|
||||
* Draftail editor no longer crashes after deleting image/embed using DEL key (Thibaud Colas)
|
||||
* Breadcrumb navigation now respects custom ``get_admin_display_title`` methods (Arthur Holzner, Wietze Helmantel, Matt Westcott)
|
||||
|
||||
|
||||
Upgrade considerations
|
||||
|
|
|
@ -60,7 +60,7 @@ def explorer_breadcrumb(context, page, include_self=False):
|
|||
return {'pages': Page.objects.none()}
|
||||
|
||||
return {
|
||||
'pages': page.get_ancestors(inclusive=include_self).descendant_of(cca, inclusive=True)
|
||||
'pages': page.get_ancestors(inclusive=include_self).descendant_of(cca, inclusive=True).specific()
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -303,6 +303,21 @@ class TestPageExplorer(TestCase, WagtailTestUtils):
|
|||
self.assertTemplateUsed(response, 'wagtailadmin/pages/index.html')
|
||||
|
||||
|
||||
class TestBreadcrumb(TestCase, WagtailTestUtils):
|
||||
fixtures = ['test.json']
|
||||
|
||||
def test_breadcrumb_uses_specific_titles(self):
|
||||
self.user = self.login()
|
||||
|
||||
# get the explorer view for a subpage of a SimplePage
|
||||
page = Page.objects.get(url_path='/home/secret-plans/steal-underpants/')
|
||||
response = self.client.get(reverse('wagtailadmin_explore', args=(page.id, )))
|
||||
|
||||
# The breadcrumb should pick up SimplePage's overridden get_admin_display_title method
|
||||
expected_url = reverse('wagtailadmin_explore', args=(Page.objects.get(url_path='/home/secret-plans/').id, ))
|
||||
self.assertContains(response, """<li><a href="%s">Secret plans (simple page)</a></li>""" % expected_url)
|
||||
|
||||
|
||||
class TestPageExplorerSignposting(TestCase, WagtailTestUtils):
|
||||
fixtures = ['test.json']
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue