Ejemplo n.º 1
0
 def test_create_activatable_affil_empty_course_string(self):
     self.assertIsNone(
         CourseGroupMapper.create_activatable_affil(self.user, '', 2016))
     self.assertIsNone(
         CourseGroupMapper.create_activatable_affil(self.user, '', None))
     self.assertIsNone(
         CourseGroupMapper.create_activatable_affil(None, '', None))
     self.assertIsNone(
         CourseGroupMapper.create_activatable_affil(
             AnonymousUser(), '', 2016))
Ejemplo n.º 2
0
 def test_create_activatable_affil_student_course_string(self):
     s = 't1.y2016.s001.cf1000.scnc.st.course:columbia.edu'
     self.assertIsNone(
         CourseGroupMapper.create_activatable_affil(self.user, s, 2016))
     self.assertIsNone(
         CourseGroupMapper.create_activatable_affil(self.user, s, None))
     self.assertIsNone(
         CourseGroupMapper.create_activatable_affil(None, s, None))
     self.assertIsNone(
         CourseGroupMapper.create_activatable_affil(
             AnonymousUser(), s, 2016))
Ejemplo n.º 3
0
    def test_create_activatable_affil_faculty_course_string(self):
        s = 't1.y2016.s001.cf1000.scnc.fc.course:columbia.edu'
        aa = CourseGroupMapper.create_activatable_affil(self.user, s, 2016)
        self.assertIsNotNone(aa)
        self.assertEqual(aa.name, s)
        self.assertEqual(aa.user, self.user)

        self.assertIsNone(
            CourseGroupMapper.create_activatable_affil(self.user, s, 2017))
        self.assertIsNone(
            CourseGroupMapper.create_activatable_affil(self.user, s, None))
        self.assertIsNone(
            CourseGroupMapper.create_activatable_affil(None, s, None))
        self.assertIsNone(
            CourseGroupMapper.create_activatable_affil(
                AnonymousUser(), s, 2016))
Ejemplo n.º 4
0
 def test_create_activatable_affil_misc_course_string(self):
     self.assertIsNone(
         CourseGroupMapper.create_activatable_affil(
             self.user, 'ALL_CU', 2016))