'Scenario:
Course Date should have the format \'Ended - Sep 23, 2015\'
if the course on student dashboard has ended.
As a Student,
Given that I have enrolled to a course
And the course has ended in the past
When I visit dashboard page
Then the course date should have the following format "Ended - %b %d, %Y" e.g. "Ended - Sep 23, 2015"'

def test_ended_course_date(self):

    course_start_date = datetime.datetime(1970, 1, 1)
    course_end_date = (self.now - datetime.timedelta(days=90))
    self.course_fixture.add_course_details({'start_date': course_start_date, 'end_date': course_end_date})
    self.course_fixture.configure_course()
    end_date = DEFAULT_SHORT_DATE_FORMAT.format(dt=course_end_date)
    expected_course_date = 'Ended    -    {end_date}'.format(end_date=end_date)
    self.dashboard_page.visit()
    course_date = self.dashboard_page.get_course_date()
    self.assertEqual(course_date, expected_course_date)
