'Given that I am a staff member on the subsection settings section
And I select the advanced settings tab
When I Make the subsection hidden after its due date.
And I login as a student.
And visit the subsection in the courseware as a verified student.
Then I am able to see the subsection
And when I visit the progress page
Then I should be able to see my grade on the progress page
When I log in as staff
And I make the subsection due in the past so that the current date is past its due date
And I log in as a student
And I visit the subsection in the courseware
Then the subsection should be hidden with a message that its due date has passed
And when I visit the progress page
Then I should be able to see my grade on the progress page'

def test_subsecton_hidden_after_due_date(self):

    self.logout_page.visit()
    auto_auth(self.browser, self.USERNAME, self.EMAIL, False, self.course_id)
    self.courseware_page.visit()
    self.assertFalse(self.courseware_page.content_hidden_past_due_date())
    self.progress_page.visit()
    self.assertEqual(self.progress_page.scores('Test    Section    1', 'Test    Subsection    1'), [(0, 1)])
    self.logout_page.visit()
    auto_auth(self.browser, 'STAFF_TESTER', 'staff101@example.com', True, self.course_id)
    self.studio_course_outline.visit()
    last_week = (datetime.today() - timedelta(days=7)).strftime('%m/%d/%Y')
    self.studio_course_outline.change_problem_due_date(last_week)
    self.logout_page.visit()
    auto_auth(self.browser, self.USERNAME, self.EMAIL, False, self.course_id)
    self.courseware_page.visit()
    self.assertTrue(self.courseware_page.content_hidden_past_due_date())
    self.progress_page.visit()
    self.assertEqual(self.progress_page.scores('Test    Section    1', 'Test    Subsection    1'), [(0, 1)])
