'Scenario: A published unit can be published again after deleting a child
Given I have a published unit with no unpublished changes
When I go to the unit page in Studio
And delete the only component
Then the title in the Publish information box is "Draft (Unpublished changes)"
And when I click the Publish button
Then the title in the Publish information box is "Published and Live"
And when I click the View Live button
Then I see an empty unit in LMS'

def test_delete_child_in_published_unit(self):

    unit = self.go_to_unit_page()
    unit.delete(0)
    unit.verify_publish_title(self.DRAFT_STATUS)
    unit.publish_action.click()
    unit.wait_for_ajax()
    unit.verify_publish_title(self.PUBLISHED_LIVE_STATUS)
    self._view_published_version(unit)
    self.assertEqual(0, self.courseware.num_xblock_components)
