'Helper for test cases that use a modification to decide whether
to update the course status'

def _date_sync(self, date, initial_unit, update_unit, expected_subsection):

    self.login_and_enroll()
    self.api_response(data={'last_visited_module_id': unicode(initial_unit.location)})
    response = self.api_response(data={'last_visited_module_id': unicode(update_unit.location), 'modification_date': date.isoformat()})
    self.assertEqual(response.data['last_visited_module_id'], unicode(expected_subsection.location))
