def test_map_user_group_does_not_exist(self): affils = [self.user.username, 'CUcourse_ENGLW3872:columbia.edu'] self.assertEquals(self.user.groups.count(), 0) CourseGroupMapper.map(self.user, affils) self.assertEquals(self.user.groups.count(), 0)
def test_map_user_student_affiliation(self): affils = [self.user.username, self.course.group.name] self.assertEquals(self.user.groups.count(), 0) CourseGroupMapper.map(self.user, affils) self.assertEquals(self.user.groups.count(), 1) self.assertTrue(self.course.group in self.user.groups.all())
def test_map_user_uniremoved(self): affils = [self.user.username] self.assertEquals(self.user.groups.count(), 0) CourseGroupMapper.map(self.user, affils) self.assertEquals(self.user.groups.count(), 0)