python - Test if a class is inherited from another -
this question more python related django related. want test write test function using django form dynamically fields set.
def quiz_form_factory(question): properties = { 'question': forms.integerfield(widget=forms.hiddeninput, initial=question.id), 'answers': forms.modelchoicefield(queryset=question.answers_set) } return type('quizform', (forms.form,), properties) i want test if, quizform class returned inherited forms.form.
something like:
self.asserttrue(quizform isinheritedfrom forms.form) # know not exist is there way this?
Comments
Post a Comment