Since Wagtail 2.13.x, the render_form method is removed from the FieldBlock (A block inherited by most default blocks such as CharBlock, TextBlock etc.)
How are these blocks rendered using Wagtail 2.13.x?
A test for rendering a block is as follows:
def test_form_render(self):
block = FormChooserBlock()
test_form_html = block.render_form(self.form, "form")
expected_html = "\n".join(
[
'<select name="form" placeholder="" id="form">',
'<option value="">---------</option>',
'<option value="%s" selected>Basic Form</option>' % self.form.id,
"</select>",
]
)
self.assertInHTML(expected_html, test_form_html)
Obviously, this test breaks when upgrading to wagtail 2.13.x, because the render_form method is not an attribute of block anymore.