コード例 #1
0
 def test_has_paid_final_grade_none(self):
     """
     Test that has_paid_final_grade returns False when a FinalGrade doesn't exist
     """
     mmtrack = MMTrack(user=self.user,
                       program=self.program,
                       edx_user_data=self.cached_edx_user_data)
     assert mmtrack.has_paid_final_grade('random-course-id') is False
コード例 #2
0
ファイル: utils_test.py プロジェクト: mitodl/micromasters
 def test_has_paid_final_grade_none(self):
     """
     Test that has_paid_final_grade returns False when a FinalGrade doesn't exist
     """
     mmtrack = MMTrack(
         user=self.user,
         program=self.program,
         edx_user_data=self.cached_edx_user_data
     )
     assert mmtrack.has_paid_final_grade('random-course-id') is False
コード例 #3
0
 def test_has_paid_final_grade(self, has_paid):
     """
     Test that has_paid_final_grade returns True when the associated FinalGrade is paid
     """
     final_grade = FinalGradeFactory.create(user=self.user,
                                            course_run=self.cruns[0],
                                            course_run_paid_on_edx=has_paid)
     mmtrack = MMTrack(user=self.user,
                       program=self.program,
                       edx_user_data=self.cached_edx_user_data)
     assert mmtrack.has_paid_final_grade(
         final_grade.course_run.edx_course_key) is has_paid
コード例 #4
0
ファイル: utils_test.py プロジェクト: mitodl/micromasters
 def test_has_paid_final_grade(self, has_paid):
     """
     Test that has_paid_final_grade returns True when the associated FinalGrade is paid
     """
     final_grade = FinalGradeFactory.create(
         user=self.user,
         course_run=self.cruns[0],
         course_run_paid_on_edx=has_paid
     )
     mmtrack = MMTrack(
         user=self.user,
         program=self.program,
         edx_user_data=self.cached_edx_user_data
     )
     assert mmtrack.has_paid_final_grade(final_grade.course_run.edx_course_key) is has_paid