'Verify that learner cannot get the financial aid for the courses having one of the
following attributes:
1. User is enrolled in the verified mode.
2. Course is expired.
3. Course does not provide financial assistance.
4. Course does not have verified mode.'

@ddt.data(([CourseMode.AUDIT, CourseMode.VERIFIED], CourseMode.AUDIT, True, (datetime.now(UTC) - timedelta(days=1))), ([CourseMode.AUDIT, CourseMode.VERIFIED], CourseMode.VERIFIED, True, None), ([CourseMode.AUDIT, CourseMode.VERIFIED], CourseMode.AUDIT, False, None), ([CourseMode.AUDIT], CourseMode.AUDIT, False, None))
@ddt.unpack
def test_financial_assistance_form_course_exclusion(self, course_modes, enrollment_mode, eligible_for_aid, expiration):

    course = CourseFactory.create()
    for mode in course_modes:
        CourseModeFactory.create(mode_slug=mode, course_id=course.id, expiration_datetime=expiration)
    CourseEnrollmentFactory(course_id=course.id, user=self.user, mode=enrollment_mode)
    CourseOverview.get_from_id(course.id)
    course_overview = CourseOverview.objects.get(id=course.id)
    course_overview.eligible_for_financial_aid = eligible_for_aid
    course_overview.save()
    url = reverse('financial_assistance_form')
    response = self.client.get(url)
    self.assertEqual(response.status_code, 200)
    self.assertNotIn(str(course.id), response.content)
