Beispiel #1
0
 def test_tool_not_visible_when_end_date_passed(self):
     self.course_overview.end_date = self.now - datetime.timedelta(days=30)
     self.course_overview.save()
     self.assertFalse(FinancialAssistanceTool().is_enabled(
         self.request, self.course_overview.id))
Beispiel #2
0
 def test_tool_not_visible_when_already_upgraded(self, get_enrollment_mock):
     self.course_financial_mode.save()
     get_enrollment_mock.return_value = self.enrollment_upgraded
     self.assertFalse(FinancialAssistanceTool().is_enabled(
         self.request, self.course.id))
Beispiel #3
0
 def test_not_visible_when_no_upgrade_deadline(self, get_enrollment_mock):
     get_enrollment_mock.return_value = self.enrollment_deadline_missing
     self.assertFalse(FinancialAssistanceTool().is_enabled(
         self.request, self.course.id))
Beispiel #4
0
 def test_tool_not_visible_when_user_not_enrolled(self):
     self.course_financial_mode.save()
     self.request.user = None
     self.assertFalse(FinancialAssistanceTool().is_enabled(
         self.request, self.course.id))
Beispiel #5
0
 def test_tool_not_visible_when_not_eligible(self):
     self.course_overview.eligible_for_financial_aid = False
     self.course_overview.save()
     self.assertFalse(FinancialAssistanceTool().is_enabled(
         self.request, self.course_overview.id))
Beispiel #6
0
 def test_tool_visible_logged_in(self):
     self.course_financial_mode.save()
     self.assertTrue(FinancialAssistanceTool().is_enabled(
         self.request, self.course.id))
Beispiel #7
0
 def test_not_visible_when_upgrade_deadline_has_passed(
         self, get_enrollment_mock):
     get_enrollment_mock.return_value = self.enrollment_deadline_past
     assert not FinancialAssistanceTool().is_enabled(
         self.request, self.course.id)