'Tests resume course when the last accessed sequential is deleted and
there is another sequential in the vertical.'

def test_resume_course_deleted_sequential(self):

    course = self.create_test_course()
    chapter = course.children[0]
    self.assertGreaterEqual(len(chapter.children), 2)
    sequential = chapter.children[0]
    sequential2 = chapter.children[1]
    self.visit_sequential(course, chapter, sequential)
    with self.store.branch_setting(ModuleStoreEnum.Branch.draft_preferred, course.id):
        self.store.delete_item(sequential.location, self.user.id)
    response = self.client.get(course_home_url(course))
    self.assertEqual(response.status_code, 200)
    self.assertContains(response, 'Start    Course', count=0)
    self.assertContains(response, 'Resume    Course', count=2)
    content = pq(response.content)
    self.assertTrue(content('.action-resume-course').attr('href').endswith(('/sequential/' + sequential2.url_name)))
