kopia lustrzana https://github.com/wagtail/wagtail
Fix test_override_heading test
rodzic
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")
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue