'Ensure that the following four use cases work as expected
1) Anonymous users are shown a course message linking them to the login page
2) Unenrolled users are shown a course message allowing them to enroll
3) Enrolled users who show up on the course page after the course has begun
are not shown a course message.
4) Enrolled users who show up on the course page before the course begins
are shown a message explaining when the course starts as well as a call to
action button that allows them to add a calendar event.'

@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=True)
@override_waffle_flag(COURSE_PRE_START_ACCESS_FLAG, active=True)
def test_course_messaging(self):

    url = course_home_url(self.course)
    response = self.client.get(url)
    self.assertContains(response, TEST_COURSE_HOME_MESSAGE)
    self.assertContains(response, TEST_COURSE_HOME_MESSAGE_ANONYMOUS)
    self.user = self.create_user_for_course(self.course, CourseUserType.UNENROLLED)
    url = course_home_url(self.course)
    response = self.client.get(url)
    self.assertContains(response, TEST_COURSE_HOME_MESSAGE)
    self.assertContains(response, TEST_COURSE_HOME_MESSAGE_UNENROLLED)
    CourseEnrollment.enroll(self.user, self.course.id)
    url = course_home_url(self.course)
    response = self.client.get(url)
    self.assertNotContains(response, TEST_COURSE_HOME_MESSAGE)
    future_course = self.create_future_course()
    CourseEnrollment.enroll(self.user, future_course.id)
    url = course_home_url(future_course)
    response = self.client.get(url)
    self.assertContains(response, TEST_COURSE_HOME_MESSAGE)
    self.assertContains(response, TEST_COURSE_HOME_MESSAGE_PRE_START)
