def assertFieldOutput(self, fieldclass, valid, invalid, field_args=[],
            field_kwargs={}, empty_value=u''):
        required = fieldclass(*field_args, **field_kwargs)
        optional = fieldclass(*field_args, **dict(field_kwargs, required=False))
        # test valid inputs
        for input, output in valid.items():
            self.assertEqual(required.clean(input), output)
            self.assertEqual(optional.clean(input), output)
        # test invalid inputs
        for input, errors in invalid.items():
            self.assertRaisesRegexp(ValidationError, unicode(errors),
                required.clean, input
            )
            self.assertRaisesRegexp(ValidationError, unicode(errors),
                optional.clean, input
            )
        # test required inputs
        error_required = u'This field is required'
        for e in EMPTY_VALUES:
            self.assertRaisesRegexp(ValidationError, error_required,
                required.clean, e)
            self.assertEqual(optional.clean(e), empty_value)
Creates a wxPython subpanel-based user interface using information
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.3/tests/regressiontests/forms/localflavor/utils.py/LocalFlavorTestCase.assertFieldOutput--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/wx/toolkit.py/GUIToolkit.ui_subpanel