kopia lustrzana https://github.com/wagtail/wagtail
rodzic
28cde800d9
commit
8cdeb23a43
|
@ -1,7 +1,7 @@
|
|||
{% load wagtailadmin_tags %}
|
||||
<td {% if column.classname %}class="{{ column.classname }}"{% endif %}>
|
||||
{% if value %}
|
||||
<a href="{% url 'wagtailadmin_choose_page_child' value.id %}" class="navigate-parent">{{ value.get_admin_display_title }}</a>
|
||||
<a href="{% url 'wagtailadmin_choose_page_child' value.id %}{% querystring p=None q=None %}" class="navigate-parent">{{ value.get_admin_display_title }}</a>
|
||||
{% if show_locale_labels %}{% status value.locale.get_display_name classname="w-status--label" %}{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
|
|
|
@ -371,12 +371,22 @@ class TestChooserSearch(WagtailTestUtils, TransactionTestCase):
|
|||
return self.client.get(reverse("wagtailadmin_choose_page_search"), params or {})
|
||||
|
||||
def test_simple(self):
|
||||
response = self.get({"q": "foobarbaz"})
|
||||
response = self.get({"q": "foobarbaz", "allow_external_link": "true"})
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTemplateUsed(response, "wagtailadmin/chooser/_search_results.html")
|
||||
self.assertContains(response, "There is 1 match")
|
||||
self.assertContains(response, "foobarbaz")
|
||||
|
||||
# parent page link should preserve the allow_external_link parameter
|
||||
expected_url = (
|
||||
reverse("wagtailadmin_choose_page_child", args=[self.root_page.id])
|
||||
+ "?allow_external_link=true"
|
||||
)
|
||||
self.assertContains(
|
||||
response,
|
||||
f'<a href="{expected_url}" class="navigate-parent">{self.root_page.title}</a>',
|
||||
)
|
||||
|
||||
def test_partial_match(self):
|
||||
response = self.get({"q": "fooba"})
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
|
Ładowanie…
Reference in New Issue