def get_allowlisted_users(course_key): """ Return the users who are on the allowlist for this course run """ if not _is_using_certificate_allowlist(course_key): return User.objects.none() return User.objects.filter(certificatewhitelist__course_id=course_key, certificatewhitelist__whitelist=True)
def test_is_using_allowlist_false(self): """ Test the allowlist flag without the override """ self.assertFalse(_is_using_certificate_allowlist(self.course_run_key))
def test_is_using_allowlist_true(self): """ Test the allowlist flag """ self.assertTrue(_is_using_certificate_allowlist(self.course_run_key))