def test_fieldset_of_fieldsets_with_noreq(self):
        class _Form(Form):
            fields=[
                FieldSet('sets', fields=[
                    FieldSet('set1', fields=[
                        Field('first', convs.Int(required=False), permissions='r'),
                        Field('second', convs.Int()),
                    ]),
                    FieldSet('set2', fields=[
                        Field('first', convs.Int()),
                        Field('second', convs.Int(required=False), permissions='r'),
                    ]),
                ]),
            ]
        env = AppEnvironment.create()
        form = _Form(env, initial={'sets':{
            'set1': {'first': None, 'second': 2},
            'set2': {'first': 1, 'second': None},
        }})

        self.assertEqual(form.raw_data, MultiDict(**{
            'sets.set1.first': '',
            'sets.set1.second': '2',
            'sets.set2.first': '1',
            'sets.set2.second': '',
        }))

        self.assert_(form.accept(MultiDict(**{
            'sets.set1.first': 'incorect',
            'sets.set1.second': '2',
            'sets.set2.first': '1',
            'sets.set2.second': 'incorect',
        })))

        self.assertEqual(form.python_data, {'sets': {
            'set1': {'first': None, 'second': 2}, 
            'set2': {'first': 1, 'second': None}, 
        }})

        self.assertEqual(form.raw_data, MultiDict(**{
            'sets.set1.first': '',
            'sets.set1.second': '2',
            'sets.set2.first': '1',
            'sets.set2.second': '',
        }))
Accept of readonly fieldset of fieldsets with required=False
dataset/ETHPy150Open SmartTeleMax/iktomi/tests/forms/forms.py/FormReadonlyFieldsTest.test_fieldset_of_fieldsets_with_noreq