def test_toElementFields(self):
        fields = [data_form.Field('fixed', value='Section 1'),
                  data_form.Field('text-single',
                                  var='botname',
                                  label='The name of your bot'),
                  data_form.Field('text-multi',
                                  var='description',
                                  label='Helpful description of your bot'),
                  data_form.Field('boolean',
                                  var='public',
                                  label='Public bot?',
                                  required=True)
                 ]
        form = data_form.Form('form', fields=fields)
        element = form.toElement()

        elements = list(element.elements())
        self.assertEqual(4, len(elements))
        for field in elements:
            self.assertEqual('field', field.name)
            self.assertEqual(NS_X_DATA, field.uri)

        # Check order
        self.assertEqual('fixed', elements[0]['type'])
        self.assertEqual('botname', elements[1]['var'])
        self.assertEqual('description', elements[2]['var'])
        self.assertEqual('public', elements[3]['var'])
Fields are rendered as child elements, in order.
dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_data_form.py/FormTest.test_toElementFields