예제 #1
0
 def setUp(self):
     super(CourseEnrollmentBadgeTest, self).setUp()
     self.badge_classes = [
         RandomBadgeClassFactory(issuing_component='openedx__course'),
         RandomBadgeClassFactory(issuing_component='openedx__course'),
         RandomBadgeClassFactory(issuing_component='openedx__course'),
     ]
     nums = ['3', '5', '8']
     entries = [
         ','.join(pair)
         for pair in zip(nums, [badge.slug for badge in self.badge_classes])
     ]
     enrollment_config = '\r'.join(entries)
     self.config = CourseEventBadgesConfigurationFactory(
         courses_enrolled=enrollment_config)
예제 #2
0
 def setUp(self, **kwargs):
     super(CourseCompletionBadgeTest, self).setUp()
     self.badge_classes = [
         RandomBadgeClassFactory(issuing_component='openedx__course'),
         RandomBadgeClassFactory(issuing_component='openedx__course'),
         RandomBadgeClassFactory(issuing_component='openedx__course'),
     ]
     nums = ['2', '6', '9']
     entries = [
         ','.join(pair)
         for pair in zip(nums, [badge.slug for badge in self.badge_classes])
     ]
     completed_config = '\r'.join(entries)
     self.config = CourseEventBadgesConfigurationFactory.create(
         courses_completed=completed_config)
     self.config.clean_fields()
예제 #3
0
 def setUp(self, **kwargs):
     super(CourseCompletionBadgeTest, self).setUp()
     self.badge_classes = [
         RandomBadgeClassFactory(
             issuing_component='openedx__course'
         ),
         RandomBadgeClassFactory(
             issuing_component='openedx__course'
         ),
         RandomBadgeClassFactory(
             issuing_component='openedx__course'
         ),
     ]
     nums = ['2', '6', '9']
     entries = [','.join(pair) for pair in zip(nums, [badge.slug for badge in self.badge_classes])]
     completed_config = '\r'.join(entries)
     self.config = CourseEventBadgesConfigurationFactory.create(courses_completed=completed_config)
     self.config.clean_fields()
 def setUp(self):
     super(CourseGroupBadgeTest, self).setUp()
     self.badge_classes = [
         RandomBadgeClassFactory(issuing_component='openedx__course'),
         RandomBadgeClassFactory(issuing_component='openedx__course'),
         RandomBadgeClassFactory(issuing_component='openedx__course'),
     ]
     self.courses = []
     for _badge_class in self.badge_classes:
         self.courses.append(
             [CourseFactory().location.course_key for _i in range(3)])
     lines = [
         badge_class.slug + ',' +
         ','.join([unicode(course_key) for course_key in keys])
         for badge_class, keys in zip(self.badge_classes, self.courses)
     ]
     config = '\r'.join(lines)
     self.config = CourseEventBadgesConfigurationFactory(
         course_groups=config)
     self.config_map = dict(zip(self.badge_classes, self.courses))