mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Fix test_override_heading test
This commit is contained in:
parent
cc430e2bb1
commit
75597f4527
@ -421,14 +421,15 @@ class TestFieldPanel(TestCase):
|
||||
field_panel.db_field
|
||||
|
||||
def test_override_heading(self):
|
||||
# unless heading is specified in keyword arguments, a bound edit handler should take its
|
||||
# unless heading is specified in keyword arguments, an edit handler with bound form should take its
|
||||
# heading from the bound field label
|
||||
self.assertEqual(self.end_date_panel.heading, self.end_date_panel.bound_field.label)
|
||||
bound_panel = self.end_date_panel.bind_to(form=self.EventPageForm())
|
||||
self.assertEqual(bound_panel.heading, bound_panel.bound_field.label)
|
||||
|
||||
# if heading is explicitly provided to constructor, that heading should be taken in
|
||||
# preference to the field's label
|
||||
end_date_panel_with_overridden_heading = (FieldPanel('date_to', classname='full-width', heading="New heading")
|
||||
.bind_to(model=EventPage, request=self.request))
|
||||
.bind_to(model=EventPage, request=self.request, form=self.EventPageForm()))
|
||||
self.assertEqual(end_date_panel_with_overridden_heading.heading, "New heading")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user