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'))
示例#2
0
    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')
示例#4
0
    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"))