def test_datetime():
 datetime_chart = DateTimeLine(truncate_label=1000)
 datetime_chart.add('datetimes', [(datetime(2013, 1, 2, 1, 12, 29), 300), (datetime(2013, 1, 12, 21, 2, 29), 412), (datetime(2013, 2, 2, 12, 30, 59), 823), (datetime(2013, 2, 22), 672)])
 q = datetime_chart.render_pyquery()
 assert (list(map((lambda t: t.split(' ')[0]), q('.axis.x text').map(texts))) == ['2013-01-12T14:13:20', '2013-01-24T04:00:00', '2013-02-04T17:46:40', '2013-02-16T07:33:20'])

def test_datetime ( ) : datetime_chart = DateTimeLine ( truncate_label = 1000 ) datetime_chart . add ( 'datetimes' , [ ( datetime ( 2013 , 1 , 2 , 1 , 12 , 29 ) , 300 ) , ( datetime ( 2013 , 1 , 12 , 21 , 2 , 29 ) , 412 ) , ( datetime ( 2013 , 2 , 2 , 12 , 30 , 59 ) , 823 ) , ( datetime ( 2013 , 2 , 22 ) , 672 ) ] ) q = datetime_chart . render_pyquery ( ) assert ( list ( map ( ( lambda t : t . split ( ' ' ) [ 0 ] ) , q ( '.axis.x text' ) . map ( texts ) ) ) == [ '2013-01-12T14:13:20' , '2013-01-24T04:00:00' , '2013-02-04T17:46:40' , '2013-02-16T07:33:20' ] )
test date time validation .