def test_administrative_accesses_to_course_for_user(self): """ Test types of admin accesses to a course """ course_key = self.course.id # `administrative_accesses_to_course_for_user` returns accesses in tuple as # (`global_staff`, `course_staff`, `course_instructor`). # Order matters here, for example `True` at first index in tuple essentially means # given user is a global staff. for count, user in enumerate([self.global_staff, self.course_staff, self.course_instructor]): self.assertTrue(access.administrative_accesses_to_course_for_user(user, course_key)[count]) self.assertFalse(any(access.administrative_accesses_to_course_for_user(self.student, course_key)))
def test_administrative_accesses_to_course_for_user(self): """ Test types of admin accesses to a course """ course_key = self.course.id # `administrative_accesses_to_course_for_user` returns accesses in tuple as # (`global_staff`, `course_staff`, `course_instructor`). # Order matters here, for example `True` at first index in tuple essentially means # given user is a global staff. for count, user in enumerate([self.global_staff, self.course_staff, self.course_instructor]): self.assertTrue(access.administrative_accesses_to_course_for_user(user, course_key)[count]) self.assertFalse(any(access.administrative_accesses_to_course_for_user(self.student, course_key)))