'Scenario: I can edit settings of subsection.
Given that I have created a subsection
Then I see release date, due date and grading policy of subsection in course outline
When I click on the configuration icon
Then edit modal window is shown
And release date, due date and grading policy fields present
And they have correct initial values
Then I set new values for these fields
And I click save button on the modal
Then I see release date, due date and grading policy of subsection in course outline'

def test_can_edit_subsection(self):

    self.course_outline_page.visit()
    subsection = self.course_outline_page.section(SECTION_NAME).subsection(SUBSECTION_NAME)
    self.assertTrue(subsection.release_date)
    self.assertFalse(subsection.due_date)
    self.assertFalse(subsection.policy)
    modal = subsection.edit()
    self.assertTrue(modal.has_release_date())
    self.assertTrue(modal.has_release_time())
    self.assertTrue(modal.has_due_date())
    self.assertTrue(modal.has_due_time())
    self.assertTrue(modal.has_policy())
    self.assertEqual(modal.release_date, u'1/1/1970')
    self.assertEqual(modal.release_time, u'00:00')
    self.assertEqual(modal.due_date, u'')
    self.assertEqual(modal.due_time, u'')
    self.assertEqual(modal.policy, u'Not    Graded')
    modal.release_date = '3/12/1972'
    modal.release_time = '04:01'
    modal.due_date = '7/21/2014'
    modal.due_time = '23:39'
    modal.policy = 'Lab'
    modal.save()
    self.assertIn(u'Released:    Mar    12,    1972', subsection.release_date)
    self.assertIn(u'04:01', subsection.release_date)
    self.assertIn(u'Due:    Jul    21,    2014', subsection.due_date)
    self.assertIn(u'23:39', subsection.due_date)
    self.assertIn(u'Lab', subsection.policy)
