bpy.data.textures.new(...) error to create new textures
You have to select manually or by script object on which this texture will be applied. If the model is selected it should be highlighted or press 'R' the model should be able to rotate.