Beispiel #1
0
    def create_resolver(self):
        """
        Creates a CourseUpdateResolver with an enrollment to schedule.
        """
        enrollment = CourseEnrollmentFactory(course_id=self.course.id, user=self.user, mode='audit')

        return CourseUpdateResolver(
            async_send_task=Mock(name='async_send_task'),
            site=self.site_config.site,
            target_datetime=enrollment.schedule.start_date,
            day_offset=-7,
            bin_num=CourseUpdateResolver.bin_num_for_user_id(self.user.id),
        )
    def create_resolver(self):
        """
        Creates a CourseUpdateResolver with an enrollment to schedule.
        """
        with patch('openedx.core.djangoapps.schedules.signals.get_current_site') as mock_get_current_site:
            mock_get_current_site.return_value = self.site_config.site
            enrollment = CourseEnrollmentFactory(course_id=self.course.id, user=self.user, mode=u'audit')

        return CourseUpdateResolver(
            async_send_task=Mock(name='async_send_task'),
            site=self.site_config.site,
            target_datetime=enrollment.schedule.start,
            day_offset=-7,
            bin_num=CourseUpdateResolver.bin_num_for_user_id(self.user.id),
        )