'Assert that a user lacks access to the given action the given course.
Test with both the given course and with a CourseOverview of the given
course.
Arguments:
user (User): a user.
action (str): type of access to test.
course (CourseDescriptor): a course.
Note:
It may seem redundant to have one method for testing access
and another method for testing lack thereof (why not just combine
them into one method with a boolean flag?), but it makes reading
stack traces of failed tests easier to understand at a glance.'

def assertCannotAccessCourse(self, user, action, course):

    self.assertFalse(has_access(user, action, course))
    self.assertFalse(has_access(user, action, CourseOverview.get_from_id(course.id)))
