def METHOD_NAME(self):
    """
    Tests that the dashboard renders the recent enrollment message appropriately for two courses.
    """
    self._configure_message_timeout(600)
    course_location = locator.CourseLocator(
        'Org2',
        'Course2',
        'Run2'
    )
    course, _ = self._create_course_and_enrollment(course_location)  # lint-amnesty, pylint: disable=unused-variable
    self.client.login(username=self.student.username, password=self.PASSWORD)
    response = self.client.get(reverse("dashboard"))
    courses_enrollments = list(get_course_enrollments(self.student, None, []))
    courses_enrollments.sort(key=lambda x: x.created, reverse=True)
    assert len(courses_enrollments) == 3
    recent_course_enrollments = _get_recently_enrolled_courses(courses_enrollments)
    assert len(recent_course_enrollments) == 2
    self.assertContains(
        response,
        "Thank you for enrolling in:"
    )
    self.assertContains(
        response,
        ' and '.join(enrollment.course.display_name for enrollment in recent_course_enrollments)
    )