def test_clean_adds_form_reference(self): block = WagtailFormBlock() value = block.clean({ 'form': self.form.pk, 'form_action': '/foo/' }) self.assertIsNotNone(value.get('form_reference'))
def test_clean_keeps_existing_form_reference(self): block = WagtailFormBlock() value = block.clean({ "form": self.form.pk, "form_action": "/foo/", "form_reference": "some-ref" }) self.assertEqual(value.get("form_reference"), "some-ref")
def test_clean_keeps_existing_form_reference(self): block = WagtailFormBlock() value = block.clean({ 'form': self.form.pk, 'form_action': '/foo/', 'form_reference': 'some-ref' }) self.assertEqual(value.get('form_reference'), 'some-ref')
def test_clean_adds_form_reference(self): block = WagtailFormBlock() value = block.clean({"form": self.form.pk, "form_action": "/foo/"}) self.assertIsNotNone(value.get("form_reference"))