Exemplo n.º 1
0
 def setUp(self):
     super().setUp()
     self.user = UserFactory.create()
     self.courses = [CourseFactory.create() for __ in range(3)]
     for course in self.courses:
         chapter = ItemFactory.create(parent_location=course.location)
         ItemFactory.create(parent_location=chapter.location,
                            category='sequential',
                            graded=True)
     CourseCompleteImageConfigurationFactory.create()
 def setUp(self):
     super(CertificateManagementTest, self).setUp()  # lint-amnesty, pylint: disable=super-with-arguments
     self.user = UserFactory.create()
     self.courses = [CourseFactory.create() for __ in range(3)]
     for course in self.courses:
         chapter = ItemFactory.create(parent_location=course.location)
         ItemFactory.create(parent_location=chapter.location,
                            category='sequential',
                            graded=True)
     CourseCompleteImageConfigurationFactory.create()
Exemplo n.º 3
0
 def test_badge_callback(self, handler):
     student = UserFactory()
     course = CourseFactory.create(org='edx', number='998', display_name='Test Course', issue_badges=True)
     CourseCompleteImageConfigurationFactory()
     CourseEnrollmentFactory(user=student, course_id=course.location.course_key, mode='honor')
     cert = GeneratedCertificateFactory.create(
         user=student,
         course_id=course.id,
         status=CertificateStatuses.generating,
         mode='verified'
     )
     cert.status = CertificateStatuses.downloadable
     cert.save()
     assert handler.return_value.award.called