Esempio n. 1
0
 def create_new_approval(self):
     """
     a helper class for quickly creating a new approval item
     """
     teacher = self.create_and_return_local_user()
     course_id = new_course({
         'teacher': teacher.key.id(),
         'title': 'foo course',
         'body': 'hey look mom',
     })
     new_approval_request(course=get_course_by_id(course_id),
                          googleID='123',
                          formalName='John Doe',
                          email='*****@*****.**')
 def create_new_approval(self):
     """
     a helper class for quickly creating a new approval item
     """
     teacher = self.create_and_return_local_user()
     course_id = new_course({
         'teacher' : teacher.key.id(),
         'title' : 'foo course',
         'body' : 'hey look mom',
         })
     new_approval_request(
         course = get_course_by_id(course_id), 
         googleID='123', 
         formalName='John Doe', 
         email='*****@*****.**')
    def create_several_approvals_for_course(self, number_of_courses=1):
        """
        create a course then approve several googleID's to access the course

        a helper method for the tests in this class; returns the course for 
        which the approvals were generated. If more than 1 course is created, 
        return the user instead of course/ids
        """
        teacher = self.create_and_return_local_user()
        for N in range(number_of_courses):
            course_id = new_course({
                'teacher': teacher.key.id(),
                'title': 'foo course',
                'body': 'hey look mom',
            })
            list_of_ids_to_approve = [1, 2, 3, 4, 5]
            course = get_course_by_id(course_id)
            for i in list_of_ids_to_approve:
                new_approval_request(course=course,
                                     googleID=i,
                                     formalName='John Doe %s' % i,
                                     email='*****@*****.**' % i)
    def create_several_approvals_for_course(self, number_of_courses = 1):
        """
        create a course then approve several googleID's to access the course

        a helper method for the tests in this class; returns the course for 
        which the approvals were generated. If more than 1 course is created, 
        return the user instead of course/ids
        """
        teacher = self.create_and_return_local_user()
        for N in range(number_of_courses):
            course_id = new_course({
                'teacher' : teacher.key.id(),
                'title' : 'foo course',
                'body' : 'hey look mom',
                })
            list_of_ids_to_approve = [1,2,3,4,5]
            course = get_course_by_id(course_id)
            for i in list_of_ids_to_approve:
                new_approval_request(
                    course = course, 
                    googleID=i, 
                    formalName='John Doe %s' % i, 
                    email='*****@*****.**' % i
                    )