def test_format_job_with_no_start_date(self):
     time = '2017-10-27T18:04:47Z'
     job = {'id': '12345', 'name': 'TestJob', 'status': 'Failed'}
     formatted_time = datetime.strptime(time, '%Y-%m-%dT%H:%M:%SZ')
     result = QueryJobsResult(id=job.get('id'),
                              name=job.get('name'),
                              status=job.get('status'),
                              submission=formatted_time,
                              extensions=ExtendedFields())
     self.assertEqual(jobs_controller.format_job(job, formatted_time),
                      result)
 def test_format_job_with_no_start_date(self):
     time = '2017-10-27T18:04:47Z'
     job = {'id': '12345', 'name': 'TestJob', 'status': 'Failed'}
     formatted_time = dateutil.parser.parse(time).astimezone(tzutc())
     result = QueryJobsResult(id=job.get('id'),
                              name=job.get('name'),
                              status=job.get('status'),
                              start=formatted_time,
                              submission=formatted_time,
                              extensions=ExtendedFields())
     self.assertEqual(jobs_controller.format_job(job, formatted_time),
                      result)