'Verify the expected result from _has_access_descriptor'

def verify_access(self, mock_unit, student_should_have_access, expected_error_type=None):

    response = access._has_access_descriptor(self.anonymous_user, 'load', mock_unit, course_key=self.course.id)
    self.assertEqual(student_should_have_access, bool(response))
    if (expected_error_type is not None):
        self.assertIsInstance(response, expected_error_type)
        self.assertIsNotNone(response.to_json()['error_code'])
    self.assertTrue(access._has_access_descriptor(self.course_staff, 'load', mock_unit, course_key=self.course.id))
