'Checks if current course is accessible to current user'

def _assert_current_course(self, visible=True):

    self.dashboard_page.visit()
    courses = self.dashboard_page.list_courses()
    def check_course_equality(course1, course2):
        '    Compares    to    course    dictionaries    using    org,    number    and    run    as    keys'
        return ((course1['org'] == course2['display_organization']) and (course1['number'] == course2['display_coursenumber']) and (course1['run'] == course2['run']))
    actual_visible = any((check_course_equality(course, self.course_info) for course in courses))
    self.assertEqual(actual_visible, visible)
