def test_contributors_get_aware_datetime():
 iso_datetime = make_aware(parse_datetime('2016-01-24T23:15:22+0000'), tz=pytz.utc)
 assert (iso_datetime == get_aware_datetime('2016-01-24T23:15:22+0000', tz=pytz.utc))
 assert (iso_datetime == get_aware_datetime('2016-01-24 23:15:22 +0000', tz=pytz.utc))
 iso_datetime = make_aware(parse_datetime('2016-01-24T00:00:00+0000'), tz=pytz.utc)
 assert (iso_datetime == get_aware_datetime('2016-01-24', tz=pytz.utc))
 assert (get_aware_datetime(None) is None)
 assert (get_aware_datetime('') is None)
 with pytest.raises(ArgumentTypeError):
  get_aware_datetime('THIS FAILS')
 with pytest.raises(ArgumentTypeError):
  get_aware_datetime(' ')

def test_contributors_get_aware_datetime ( ) : iso_datetime = make_aware ( parse_datetime ( '2016-01-24T23:15:22+0000' ) , tz = pytz . utc ) assert ( iso_datetime == get_aware_datetime ( '2016-01-24T23:15:22+0000' , tz = pytz . utc ) ) assert ( iso_datetime == get_aware_datetime ( '2016-01-24 23:15:22 +0000' , tz = pytz . utc ) ) iso_datetime = make_aware ( parse_datetime ( '2016-01-24T00:00:00+0000' ) , tz = pytz . utc ) assert ( iso_datetime == get_aware_datetime ( '2016-01-24' , tz = pytz . utc ) ) assert ( get_aware_datetime ( None ) is None ) assert ( get_aware_datetime ( '' ) is None ) with pytest . raises ( ArgumentTypeError ) : get_aware_datetime ( 'THIS FAILS' ) with pytest . raises ( ArgumentTypeError ) : get_aware_datetime ( ' ' )
get an aware datetime from a valid string .