'Test that ReportStore.links_for() returns file download links
in reverse chronological order.'

def test_links_for_order(self):

    report_store = self.create_report_store()
    self.assertEqual(report_store.links_for(self.course_id), [])
    report_store.store(self.course_id, 'old_file', StringIO())
    time.sleep(1)
    report_store.store(self.course_id, 'middle_file', StringIO())
    time.sleep(1)
    report_store.store(self.course_id, 'new_file', StringIO())
    self.assertEqual([link[0] for link in report_store.links_for(self.course_id)], ['new_file', 'middle_file', 'old_file'])
