예제 #1
0
    def setUp(self):
        super(ReviewTests, self).setUp()
        self.dummy_request = RequestFactory().get('/')
        self.exam_creation_params = {
            'course_id': 'foo/bar/baz',
            'content_id': 'content',
            'exam_name': 'Sample Exam',
            'time_limit_mins': 10,
            'is_proctored': True,
            'backend': 'test'
        }
        self.exam_id = create_exam(**self.exam_creation_params)

        self.attempt_id = create_exam_attempt(
            self.exam_id,
            self.user.id,
            taking_as_proctored=True
        )

        self.attempt = get_exam_attempt_by_id(self.attempt_id)
        set_runtime_service('credit', MockCreditService())
        set_runtime_service('instructor', MockInstructorService())
        set_runtime_service('grades', MockGradesService())
        set_runtime_service('certificates', MockCertificateService())
        set_current_request(self.dummy_request)
예제 #2
0
    def setUp(self):
        """
        Initialize
        """
        super().setUp()
        self.user = User(username='******', email='*****@*****.**')
        self.user.save()

        set_runtime_service('credit', MockCreditService())
        set_runtime_service('instructor', MockInstructorService())
        set_runtime_service('grades', MockGradesService())
        set_runtime_service('certificates', MockCertificateService())
예제 #3
0
    def setUp(self):
        super(ReviewTests, self).setUp()
        self.dummy_request = RequestFactory().get('/')
        self.exam_id = create_exam(course_id='foo/bar/baz',
                                   content_id='content',
                                   exam_name='Sample Exam',
                                   time_limit_mins=10,
                                   is_proctored=True,
                                   backend='test')

        self.attempt_id = create_exam_attempt(self.exam_id,
                                              self.user.id,
                                              taking_as_proctored=True)

        self.attempt = get_exam_attempt_by_id(self.attempt_id)
        set_runtime_service('credit', MockCreditService())
        set_runtime_service('instructor', MockInstructorService())
        set_runtime_service('grades', MockGradesService())
        set_runtime_service('certificates', MockCertificateService())
        set_current_request(self.dummy_request)
예제 #4
0
    def setUp(self):
        """
        Build up test data
        """
        super(SetAttemptStatusTests, self).setUp()
        set_runtime_service('credit', MockCreditService())
        set_runtime_service('grades', MockGradesService())
        set_runtime_service('certificates', MockCertificateService())
        self.exam_id = create_exam(course_id='foo',
                                   content_id='bar',
                                   exam_name='Test Exam',
                                   time_limit_mins=90)

        ProctoredExamStudentAttempt.objects.create(
            proctored_exam_id=self.exam_id,
            user_id=self.user.id,
            external_id='foo',
            started_at=datetime.now(pytz.UTC),
            status=ProctoredExamStudentAttemptStatus.started,
            allowed_time_limit_mins=10,
            taking_as_proctored=True,
            is_sample_attempt=False)
    def setUp(self):
        """
        Build up test data
        """
        super().setUp()
        set_runtime_service('credit', MockCreditService())
        set_runtime_service('grades', MockGradesService())
        set_runtime_service('certificates', MockCertificateService())
        self.exam_id = create_exam(course_id='foo',
                                   content_id='bar',
                                   exam_name='Test Exam',
                                   time_limit_mins=90)

        self.attempt_id = create_exam_attempt(self.exam_id,
                                              self.user.id,
                                              taking_as_proctored=True)

        self.attempt = get_exam_attempt_by_id(self.attempt_id)

        ProctoredExamSoftwareSecureReview.objects.create(
            attempt_code=self.attempt['attempt_code'],
            exam_id=self.exam_id,
            student_id=self.user.id,
        )