#NEWLINE# def test_append_column_after_replace_selectable( self ) : #NEWLINE# #INDENT# basesel = select ( [ literal_column ( '1' ) . label ( 'a' ) ] ) #NEWLINE# tojoin = select ( [ literal_column ( '1' ) . label ( 'a' ) , literal_column ( '2' ) . label ( 'b' ) ] ) #NEWLINE# basefrom = basesel . alias ( 'basefrom' ) #NEWLINE# joinfrom = tojoin . alias ( 'joinfrom' ) #NEWLINE# sel = select ( [ basefrom . c . a ] ) #NEWLINE# replaced = sel . replace_selectable ( basefrom , basefrom . join ( joinfrom , ( replaced . c . a == joinfrom . c . a ) ) ) #NEWLINE# self . assert_compile ( replaced , 'SELECT basefrom.a FROM (SELECT 1 AS a) AS basefrom JOIN (SELECT 1 AS a, 2 AS b) AS joinfrom ON basefrom.a = joinfrom.a' ) #NEWLINE# replaced . append_column ( joinfrom . c . b ) #NEWLINE# self . assert_compile ( replaced , 'SELECT basefrom.a, joinfrom.b FROM (SELECT 1 AS a) AS basefrom JOIN (SELECT 1 AS a, 2 AS b) AS joinfrom ON basefrom.a = joinfrom.a' )