'Test getting courses with invalid course location (course deleted from modulestore).'

@ddt.data(ModuleStoreEnum.Type.split, ModuleStoreEnum.Type.mongo)
def test_get_course_list_with_invalid_course_location(self, store):

    with self.store.default_store(store):
        course_key = self.store.make_course_key('Org', 'Course', 'Run')
        self._create_course_with_access_groups(course_key, self.user, store)
    (courses_iter, __) = _accessible_courses_iter(self.request)
    courses_list = list(courses_iter)
    self.assertEqual(len(courses_list), 1)
    (courses_summary_iter, __) = _accessible_courses_summary_iter(self.request)
    courses_summary_list = list(courses_summary_iter)
    self.assertTrue(all((isinstance(course, CourseSummary) for course in courses_summary_list)))
    self.assertEqual(len(courses_summary_list), 1)
    (courses_list_by_groups, __) = _accessible_courses_list_from_groups(self.request)
    self.assertEqual(len(courses_list_by_groups), 1)
    self.assertEqual(courses_list, courses_list_by_groups)
    delete_course(course_key, self.user.id)
    CourseInstructorRole(course_key).add_users(self.user)
    (courses_iter, __) = _accessible_courses_iter(self.request)
    (courses_summary_iter, __) = _accessible_courses_summary_iter(self.request)
    (courses_list_by_groups, __) = _accessible_courses_list_from_groups(self.request)
    self.assertEqual([len(list(courses_iter)), len(courses_list_by_groups), len(list(courses_summary_iter))], [0, 0, 0])
