'Test the type of Formset and Form error attributes'

def test_error_class(self):

    Formset = modelformset_factory(User, fields=u'__all__')
    data = {u'form-TOTAL_FORMS': u'2', u'form-INITIAL_FORMS': u'0', u'form-MAX_NUM_FORMS': u'0', u'form-0-id': u'', u'form-0-username': u'apollo13', u'form-0-serial': u'1', u'form-1-id': u'', u'form-1-username': u'apollo13', u'form-1-serial': u'2'}
    formset = Formset(data)
    self.assertIsInstance(formset.errors, list)
    self.assertIsInstance(formset.non_form_errors(), ErrorList)
    for form in formset.forms:
        self.assertIsInstance(form.errors, ErrorDict)
        self.assertIsInstance(form.non_field_errors(), ErrorList)
