def is_text_serializer(serializer):
 return isinstance(serializer.dumps({}), text_type)

def is_text_serializer ( serializer ) : return isinstance ( serializer . dumps ( { } ) , text_type )
checks wheather a serializer generates text or binary .