Пример #1
0
 def setUp(self):
     super(TestEdxCourseModel, self).setUp()
     self.course = EdxCourse(
         title='title',
         org='org',
         course='course',
         run='run',
     )
Пример #2
0
    def setUp(self):
        super(TestBase, self).setUp()
        self.edx_course_id = 42
        self.edx_course = EdxCourse(title='EdX Course Title',
                                    org='edX_course_org',
                                    course='edX_course_course',
                                    run='edX_course_run',
                                    key_version=1)
        self.edx_course_key = self.edx_course.course_key()
        self.edx_usage_id = 'edx_content_usage_id'
        self.content_title = 'content item title'
        self.edx_url_base = 'https://edx.example.com'
        settings.EDX_URL_BASE = self.edx_url_base

        self.canvas_course_id = 256
        self.canvas_module_id = 123
        self.canvas_user_id = 'value of the LTI user_id field'
        self.canvas_api_token = 'Token to access the Canvas API'
        self.canvas_api_authorization = CanvasApiAuthorization(
            lti_user_id=self.canvas_user_id,
            canvas_api_token=self.canvas_api_token,
        )
        self.canvas_external_tool_id = 12
        self.module_list = ['Module 1', 'Module 2']
        self.canvas_course = dict(id=234, )

        self.authorization_mock = self.setup_patch(
            'edx2canvas.models.CanvasApiAuthorization.objects.get',
            self.canvas_api_authorization)
        self.setup_patch('edx2canvas.models.EdxCourse.objects.get',
                         self.edx_course)
        self.setup_patch('edx2canvas.models.EdxCourse.objects.all',
                         [self.edx_course])
        self.setup_patch('edx2canvas.canvas_api.get_module_list',
                         self.module_list)
        self.setup_patch('edx2canvas.canvas_api.get_courses',
                         [self.canvas_course])