#NEWLINE# @ testing . fails_on ( 'firebird' , "doesn't like ORDER BY with UNIONs" ) #NEWLINE# @ testing . requires . subqueries #NEWLINE# def test_union_ordered_alias( self ) : #NEWLINE# #INDENT# ( s1 , s2 ) = ( select ( [ t1 . c . col3 . label ( 'col3' ) , t1 . c . col4 . label ( 'col4' ) ] , t1 . c . col2 . in_ ( [ 't1col2r1' , 't1col2r2' ] ) ) , select ( [ t2 . c . col3 . label ( 'col3' ) , t2 . c . col4 . label ( 'col4' ) ] , t2 . c . col2 . in_ ( [ 't2col2r2' , 't2col2r3' ] ) ) ) #NEWLINE# u = union ( s1 , s2 , order_by = [ 'col3' , 'col4' ] ) #NEWLINE# wanted = [ ( 'aaa' , 'aaa' ) , ( 'bbb' , 'bbb' ) , ( 'bbb' , 'ccc' ) , ( 'ccc' , 'aaa' ) ] #NEWLINE# eq_ ( u . alias ( 'bar' ) . select ( ) . execute ( ) . fetchall ( ) , wanted )