'Make sure we filter out all dangling items'

def test_dangling_exam(self):

    chapter = ItemFactory.create(parent=self.course, category='chapter', display_name='Test    Section')
    ItemFactory.create(parent=chapter, category='sequential', display_name='Test    Proctored    Exam', graded=True, is_time_limited=True, default_time_limit_minutes=10, is_proctored_exam=True, hide_after_due=False)
    listen_for_course_publish(self, self.course.id)
    exams = get_all_exams_for_course(unicode(self.course.id))
    self.assertEqual(len(exams), 1)
    self.store.delete_item(chapter.location, self.user.id)
    listen_for_course_publish(self, self.course.id)
    exams = get_all_exams_for_course(unicode(self.course.id))
    self.assertEqual(len(exams), 1)
    exam = exams[0]
    self.assertEqual(exam['is_active'], False)
