'Test the type of Formset and Form error attributes'

def test_error_class(self):

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