Add tests for has_course

and negative tests for get_course.

@nasthagiri please review