'Validate formset is a subclass of BaseModelFormSet.'

def validate_formset(self, cls, model):

    if (hasattr(cls, 'formset') and (not issubclass(cls.formset, BaseModelFormSet))):
        raise ImproperlyConfigured(("'%s.formset'    does    not    inherit    from    BaseModelFormSet." % cls.__name__))
