示例#1
0
class PracticeIntegrationTest(TestCase):
    
    def setUp(self):
        nameCourse = '2012-2'
        self.course = Course()
        self.course.name = nameCourse
        self.course.save()
    
    def tearDown(self):
        Practice.objects.filter(uid="1").delete()
        pCourse = Course.objects.get(name='2012-2')
        pCourse.delete()
      
    def testPracticeCreationCompareName(self):
        pPractice = Practice()
        pPractice.uid = "1"
        pPractice.course = self.course
        pPractice.file = "pathFile"
        pPractice.deadline = "2012-12-01" 
        pPractice.save()
        cPractice = Practice.objects.get(uid="1")
        self.assertEqual(pPractice.course.name, cPractice.course.name)
    
    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)
示例#2
0
    def setUp(self):
        nameCourse = '2012-2'
        course = Course()
        course.name = nameCourse
        course.save()

        student = Student()
        student.uid = "85000"
        student.save()

        practice = Practice()
        practice.uid = "Tp inicial"
        practice.course = course
        practice.file = "pathFile"
        practice.deadline = "2012-12-01"
        practice.save()
示例#3
0
 def setUp(self):
     nameCourse = '2012-2'
     course = Course()
     course.name = nameCourse
     course.save()
     
     student = Student()
     student.uid = "85000"
     student.save()
     
     practice = Practice()
     practice.uid = "Tp inicial"
     practice.course = course
     practice.file = "pathFile"
     practice.deadline = "2012-12-01" 
     practice.save()
示例#4
0
 def setUp(self):
     nameCourse = '2012-2'
     self.course = Course()
     self.course.name = nameCourse
     self.course.save()