'Scenario: After locking a unit with release date in the past, it is only visible to staff
Given I have a published unlocked unit with release date in the past
When I go to the unit page in Studio
And when I select "Hide from students"
Then the unit does not have a warning that it is visible to students
And the unit does not display inherited staff lock
And when I click on the View Live Button
Then I see the content in the unit when logged in as staff
And when I view the course as a student
Then I do not see any content in the unit'

def test_locked_visible_to_staff_only(self):

    unit = self.go_to_unit_page('Unlocked    Section', 'Unlocked    Subsection', 'Unlocked    Unit')
    checked = unit.toggle_staff_lock()
    self.assertTrue(checked)
    self.assertFalse(unit.currently_visible_to_students)
    self.assertFalse(unit.shows_inherited_staff_lock())
    unit.verify_publish_title(self.LOCKED_STATUS)
    self._view_published_version(unit)
    self._verify_components_visible(['problem'])
    self._verify_student_view_locked()
