def impl(context, script_name, practice_uid, course_name): course = Course.objects.get(name=course_name) practice = Practice.objects.get(uid=practice_uid, course=course) practice.delete_script() script = Script() script.file = "data/" + script_name script.practice = practice script.save()
def impl(context, script_name, practice_uid, course_name): course = Course.objects.get(name=course_name) practice = Practice.objects.get(uid=practice_uid, course=course) practice.delete_script() script = Script() script.file="data/"+script_name script.practice = practice script.save()
def load_a_script(course_name, practice_uid, script_file): course = Course.objects.get(name=course_name) practice = Practice.objects.get(course=course, uid=practice_uid) practice.get_script().delete() script = Script() script.practice = practice script.file = script_file script.save() return script
def testPracticeShouldFeatureSomeWrapperToAccessTheAssociatedScript(self): practice = Practice() practice.uid = "uid" practice.course = self.course practice.file = "pathFile" practice.deadline = "2012-12-01" practice.save() script = Script() script.practice = practice script.save() self.assertEquals(practice.get_script(), script)