def test_only_flatten_on_form_field(self):
        class DictField(Field):
            def process_formdata(self, valuelist):
                if valuelist:
                    data = valuelist[0]
                    if isinstance(data, dict):
                        self.data = data
                    else:
                        raise 'Unsupported datatype'
                else:
                    self.data = {}

        class MyForm(Form):
            a = IntegerField()
            b = DictField()

        assert (
            flatten_json(MyForm, {'a': False, 'b': {'key': 'value'}}) ==
            {'a': False, 'b': {'key': 'value'}}
        )
dataset/ETHPy150Open kvesteri/wtforms-json/tests/test_json_decoder.py/TestJsonDecoder.test_only_flatten_on_form_field/original