api_edx_cache_test.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:micromasters 作者: mitodl 项目源码 文件源码
def setUpTestData(cls):
        cls.user = UserFactory.create()
        # Create Programs, Courses, CourseRuns...
        cls.p1_course_run_keys = ['p1_course_run']
        cls.p2_course_run_keys = ['p2_course_run_1', 'p2_course_run_2']
        cls.p1_course_run = CourseRunFactory.create(edx_course_key=cls.p1_course_run_keys[0])
        p2 = FullProgramFactory.create()
        first_course = p2.course_set.first()
        extra_course = CourseFactory.create(program=p2)
        cls.p2_course_run_1 = CourseRunFactory.create(course=first_course, edx_course_key=cls.p2_course_run_keys[0])
        cls.p2_course_run_2 = CourseRunFactory.create(course=extra_course, edx_course_key=cls.p2_course_run_keys[1])
        all_course_runs = [cls.p1_course_run, cls.p2_course_run_1, cls.p2_course_run_2]
        # Create cached edX data
        cls.enrollments = [
            CachedEnrollmentFactory.create(user=cls.user, course_run=course_run) for course_run in all_course_runs
        ]
        cls.certificates = [
            CachedCertificateFactory.create(user=cls.user, course_run=course_run) for course_run in all_course_runs
        ]
        cls.current_grades = [
            CachedCurrentGradeFactory.create(user=cls.user, course_run=course_run) for course_run in all_course_runs
        ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号