def setUp(self):
     clean_up_database_tables()
     create_a_course(self.course_name)
     create_a_shift(self.shift_name, self.course_name)
     create_a_student(self.student_name, self.shift_name)
     create_a_practice(self.course_name, self.practice_deadline, self.practice_filepath, self.practice_uid)
     create_a_delivery(self.delivery_filepath, self.student_name, self.course_name, self.practice_uid, self.delivery_date)
     create_an_automatic_correction(self.delivery_filepath, self.stdout, self.exit_value, self.status)
 def setUp(self):
     clean_up_database_tables()
     create_a_course(self.course_name)
     create_a_shift(self.shift_name, self.course_name)
     create_a_student(self.student_name, self.shift_name)
     create_a_practice(self.course_name, self.practice_deadline,
                       self.practice_filepath, self.practice_uid)
     create_a_delivery(self.delivery_filepath, self.student_name,
                       self.course_name, self.practice_uid,
                       self.delivery_date)
     create_an_automatic_correction(self.delivery_filepath, self.stdout,
                                    self.exit_value, self.status)
示例#3
0
 def setUp(self):
     clean_up_database_tables()
     self.course = create_a_course(self.course_name)
     self.student = create_a_student(self.student_name, self.student_email, self.course_name)
     self.practice = create_a_practice(self.course_name, self.practice_deadline, self.practice_filepath, self.practice_uid)
     self.script = load_a_script(self.course_name, self.practice_uid, self.script_file)
     self.delivery = create_a_delivery(self.delivery_filepath, self.student_name, self.course_name, self.practice_uid, self.delivery_date)
     self.automatic_correction = create_an_automatic_correction(self.delivery_filepath, self.stdout, self.exit_value, self.status)
 def setUp(self):
     utils.clean_up_database_tables()
     
     teacher = utils.create_a_teacher(self.teacher_name)
     teacher.user.first_name = self.teacher_first_name
     teacher.user.last_name = self.teacher_last_name
     teacher.user.save()
     
     self.course = utils.create_a_course(self.course_name)
     shift = utils.create_a_shift(self.shift_name, self.course_name)
     practice = utils.create_a_practice(self.course_name, self.practice_deadline, self.practice_filepath, self.practice_uid)
     
     student1 = utils.create_a_student(self.student_name_1, self.shift_name)
     student1.user.first_name = self.student_first_name_1
     student1.user.last_name = self.student_last_name_1
     student1.user.save()
     
     student2 = utils.create_a_student(self.student_name_2, self.shift_name)
     student2.user.first_name = self.student_first_name_2
     student2.user.last_name = self.student_last_name_2
     student2.user.save()
     
     delivery_1_student_1 = utils.create_a_delivery(self.delivery_filepath1, self.student_name_1, self.course_name, self.practice_uid, self.delivery_date1)
     delivery_2_student_1 = utils.create_a_delivery(self.delivery_filepath2, self.student_name_1, self.course_name, self.practice_uid, self.delivery_date2)
     
     delivery_1_student_2 = utils.create_a_delivery(self.delivery_filepath3, self.student_name_2, self.course_name, self.practice_uid, self.delivery_date1)
     delivery_2_student_2 = utils.create_a_delivery(self.delivery_filepath4, self.student_name_2, self.course_name, self.practice_uid, self.delivery_date1)
     
     automatic_correction_1_1 = utils.create_an_automatic_correction(self.delivery_filepath1, "test automatic stdout", 1, -1)
     automatic_correction_2_1 = utils.create_an_automatic_correction(self.delivery_filepath2, "test automatic stdout", 0, 1)
     
     automatic_correction_1_2 = utils.create_an_automatic_correction(self.delivery_filepath3, "test automatic stdout", 1, -1)
     automatic_correction_2_2 = utils.create_an_automatic_correction(self.delivery_filepath4, "test automatic stdout", 0, 0)
     
     manual_correction = Correction()
     manual_correction.delivery = delivery_2_student_1
     manual_correction.grade = 8
     manual_correction.corrector = teacher
     manual_correction.save()
示例#5
0
    def setUp(self):
        utils.clean_up_database_tables()

        teacher = utils.create_a_teacher(self.teacher_name)
        teacher.user.first_name = self.teacher_first_name
        teacher.user.last_name = self.teacher_last_name
        teacher.user.save()

        self.course = utils.create_a_course(self.course_name)
        shift = utils.create_a_shift(self.shift_name, self.course_name)
        practice = utils.create_a_practice(self.course_name,
                                           self.practice_deadline,
                                           self.practice_filepath,
                                           self.practice_uid)

        student1 = utils.create_a_student(self.student_name_1, self.shift_name)
        student1.user.first_name = self.student_first_name_1
        student1.user.last_name = self.student_last_name_1
        student1.user.save()

        student2 = utils.create_a_student(self.student_name_2, self.shift_name)
        student2.user.first_name = self.student_first_name_2
        student2.user.last_name = self.student_last_name_2
        student2.user.save()

        delivery_1_student_1 = utils.create_a_delivery(self.delivery_filepath1,
                                                       self.student_name_1,
                                                       self.course_name,
                                                       self.practice_uid,
                                                       self.delivery_date1)
        delivery_2_student_1 = utils.create_a_delivery(self.delivery_filepath2,
                                                       self.student_name_1,
                                                       self.course_name,
                                                       self.practice_uid,
                                                       self.delivery_date2)

        delivery_1_student_2 = utils.create_a_delivery(self.delivery_filepath3,
                                                       self.student_name_2,
                                                       self.course_name,
                                                       self.practice_uid,
                                                       self.delivery_date1)
        delivery_2_student_2 = utils.create_a_delivery(self.delivery_filepath4,
                                                       self.student_name_2,
                                                       self.course_name,
                                                       self.practice_uid,
                                                       self.delivery_date1)

        automatic_correction_1_1 = utils.create_an_automatic_correction(
            self.delivery_filepath1, "test automatic stdout", 1, -1)
        automatic_correction_2_1 = utils.create_an_automatic_correction(
            self.delivery_filepath2, "test automatic stdout", 0, 1)

        automatic_correction_1_2 = utils.create_an_automatic_correction(
            self.delivery_filepath3, "test automatic stdout", 1, -1)
        automatic_correction_2_2 = utils.create_an_automatic_correction(
            self.delivery_filepath4, "test automatic stdout", 0, 0)

        manual_correction = Correction()
        manual_correction.delivery = delivery_2_student_1
        manual_correction.grade = 8
        manual_correction.corrector = teacher
        manual_correction.save()