コード例 #1
0
ファイル: tests.py プロジェクト: Aalto-LeTech/a-plus
 def test_groups(self):
     group = StudentGroup(course_instance=self.current_course_instance)
     group.save()
     group.members.add(self.user.userprofile,self.grader.userprofile)
     self.assertEqual(StudentGroup.get_exact(self.current_course_instance,
         [self.user.userprofile,self.grader.userprofile]), group)
     self.assertEqual(StudentGroup.get_exact(self.current_course_instance,
         [self.user.userprofile,self.superuser.userprofile]), None)
コード例 #2
0
 def test_groups(self):
     group = StudentGroup(course_instance=self.current_course_instance)
     group.save()
     group.members.add(self.user.userprofile,self.grader.userprofile)
     self.assertEqual(StudentGroup.get_exact(self.current_course_instance,
         [self.user.userprofile,self.grader.userprofile]), group)
     self.assertEqual(StudentGroup.get_exact(self.current_course_instance,
         [self.user.userprofile,self.superuser.userprofile]), None)
コード例 #3
0
 def get_group(self):
     if self.submission_count > 0:
         s = self.submissions[0]
         if s.submitters.count() > 0:
             return StudentGroup.get_exact(self.exercise.course_instance,
                                           s.submitters.all())
     return None
コード例 #4
0
 def get_group(self):
     if self.submission_count > 0:
         s = self.submissions[0]
         if s.submitters.count() > 0:
             return StudentGroup.get_exact(
                 self.exercise.course_instance,
                 s.submitters.all()
             )
     return None