Add unit test for alter_view function