示例#1
0
    def test_delivery_creation_compare_pk(self):
        student = Student.objects.get(uid="85000")
        practice = Practice.objects.get(uid="Tp inicial")

        p_delivery = Delivery()
        p_delivery.file = "pathFile"
        p_delivery.student = student
        p_delivery.practice = practice
        p_delivery.deliverDate = '2012-11-30'
        p_delivery.save()

        c_delivery = Delivery.objects.get(student=student, practice=practice)
        self.assertEqual(p_delivery.pk, c_delivery.pk)
示例#2
0
 def test_delivery_creation_compare_pk(self):
     student = Student.objects.get(uid="85000")
     practice = Practice.objects.get(uid="Tp inicial")
     
     p_delivery = Delivery()
     p_delivery.file = "pathFile"
     p_delivery.student = student
     p_delivery.practice = practice
     p_delivery.deliverDate = '2012-11-30'
     p_delivery.save()
     
     c_delivery = Delivery.objects.get(student=student, practice=practice)
     self.assertEqual(p_delivery.pk, c_delivery.pk)
示例#3
0
def step(context, practice_uid, course_name, student_uid):
    student = Student.objects.get(uid=student_uid)
    course = Course.objects.get(name=course_name)
    practice = Practice.objects.get(uid=practice_uid, course=course)
    delivery = Delivery()
    delivery.file = "data/delivery.zip"
    delivery.student = student
    delivery.practice = practice
    delivery.deliverDate = '2012-11-22'
    delivery.save()
    automatic_correction = AutomaticCorrection()
    automatic_correction.delivery = delivery
    automatic_correction.save()
示例#4
0
def step(context, practice_uid, course_name, student_uid):
    student = Student.objects.get(uid=student_uid)
    course = Course.objects.get(name=course_name)
    practice = Practice.objects.get(uid=practice_uid, course=course)
    delivery = Delivery()
    delivery.file = "data/delivery.zip"
    delivery.student = student
    delivery.practice = practice
    delivery.deliverDate = '2012-11-22'
    delivery.save()
    automatic_correction = AutomaticCorrection()
    automatic_correction.delivery = delivery
    automatic_correction.save()
示例#5
0
def step(context, practice_uid, course_name, student_uid, delivery_id):
    student = Student.objects.get(uid=student_uid)
    course = Course.objects.get(name=course_name)
    practice = Practice.objects.get(uid=practice_uid, course=course)
    # delivery = Delivery.objects.get_or_create(pk=delivery_id, student=student, practice=practice)
    delivery = Delivery()
    delivery.pk = delivery_id
    src = "data/delivery.zip"
    delivery_path = managepath.get_instance().get_delivery_path()
    dst = os.path.join(delivery_path, "delivery.zip")
    if (not os.path.exists(delivery_path)):
        makedirs(delivery_path)
    if (not os.path.exists(dst)):
        copyfile(src, dst)
    delivery.file = dst
    delivery.student = student
    delivery.practice = practice
    delivery.deliverDate = '2012-11-22'
    delivery.save()
    automatic_correction = AutomaticCorrection()
    automatic_correction.delivery = delivery
    automatic_correction.save()
示例#6
0
def step(context, practice_uid, course_name, student_uid, delivery_id):
    student = Student.objects.get(uid=student_uid)
    course = Course.objects.get(name=course_name)
    practice = Practice.objects.get(uid=practice_uid, course=course)
    # delivery = Delivery.objects.get_or_create(pk=delivery_id, student=student, practice=practice)
    delivery = Delivery()
    delivery.pk = delivery_id
    src = "data/delivery.zip"
    delivery_path = managepath.get_instance().get_delivery_path()
    dst = os.path.join(delivery_path, "delivery.zip")
    if(not os.path.exists(delivery_path)):
        makedirs(delivery_path)
    if(not os.path.exists(dst)):
        copyfile(src, dst)
    delivery.file = dst
    delivery.student = student
    delivery.practice = practice
    delivery.deliverDate = '2012-11-22'
    delivery.save()
    automatic_correction = AutomaticCorrection()
    automatic_correction.delivery = delivery
    automatic_correction.save()