예제 #1
0
    def setUp(self):
        """
        Fixtures.
        """
        super(TestSetDueDateExtension, self).setUp()

        self.due = due = datetime.datetime(2010, 5, 12, 2, 42, tzinfo=utc)
        course = CourseFactory.create()
        week1 = ItemFactory.create(due=due, parent=course)
        week2 = ItemFactory.create(due=due, parent=course)
        week3 = ItemFactory.create(parent=course)
        homework = ItemFactory.create(parent=week1)
        assignment = ItemFactory.create(parent=homework, due=due)

        user = UserFactory.create()

        self.course = course
        self.week1 = week1
        self.homework = homework
        self.assignment = assignment
        self.week2 = week2
        self.week3 = week3
        self.user = user

        inject_field_overrides((course, week1, week2, week3, homework, assignment), course, user)
예제 #2
0
    def setUp(self):
        """
        Fixtures.
        """
        super(TestSetDueDateExtension, self).setUp()

        self.due = due = datetime.datetime(2010, 5, 12, 2, 42, tzinfo=UTC)
        course = CourseFactory.create()
        week1 = ItemFactory.create(due=due, parent=course)
        week2 = ItemFactory.create(due=due, parent=course)
        week3 = ItemFactory.create(parent=course)
        homework = ItemFactory.create(parent=week1)
        assignment = ItemFactory.create(parent=homework, due=due)

        user = UserFactory.create()

        self.course = course
        self.week1 = week1
        self.homework = homework
        self.assignment = assignment
        self.week2 = week2
        self.week3 = week3
        self.user = user

        inject_field_overrides(
            (course, week1, week2, week3, homework, assignment), course, user)
예제 #3
0
    def setup_course(self, **course_kwargs):
        """Set up a course with provided course attributes.

        Creates a child block with a due date, and ensures that field
        overrides are correctly applied for both blocks.
        """
        course = CourseFactory.create(**course_kwargs)
        section = ItemFactory.create(parent=course, due=self.now)
        inject_field_overrides((course, section), course, self.user)
        return (course, section)
    def setup_course(self, **course_kwargs):
        """Set up a course with provided course attributes.

        Creates a child block with a due date, and ensures that field
        overrides are correctly applied for both blocks.
        """
        course = CourseFactory.create(**course_kwargs)
        section = ItemFactory.create(parent=course, due=self.now)
        inject_field_overrides((course, section), course, self.user)
        return (course, section)
    def setup_course(self, display_name, self_paced):
        """Set up a course with `display_name` and `self_paced` attributes.

        Creates a child block with a due date, and ensures that field
        overrides are correctly applied for both blocks.
        """
        course = CourseFactory.create(display_name=display_name, self_paced=self_paced)
        section = ItemFactory.create(parent=course, due=self.due_date)
        inject_field_overrides((course, section), course, UserFactory.create())
        return (course, section)
예제 #6
0
    def setup_course(self, display_name, self_paced):
        """Set up a course with `display_name` and `self_paced` attributes.

        Creates a child block with a due date, and ensures that field
        overrides are correctly applied for both blocks.
        """
        course = CourseFactory.create(display_name=display_name,
                                      self_paced=self_paced)
        section = ItemFactory.create(parent=course, due=self.due_date)
        inject_field_overrides((course, section), course, UserFactory.create())
        return (course, section)
 def setup_course(self, **course_kwargs):
     """ Set up a course with provided course attributes. """
     course = CourseFactory.create(**course_kwargs)
     inject_field_overrides((course, ), course, self.user)
     return course