#NEWLINE# def test_aggregate_having( self ) : #NEWLINE# #INDENT# st = self . sa_star1 . alias ( 't0' ) #NEWLINE# cases = self . _case_aggregate_having ( ) #NEWLINE# metric = F . sum ( st . c . f ) #NEWLINE# k1 = st . c . foo_id #NEWLINE# expected = [ sa . select ( [ k1 , metric . label ( 'total' ) ] ) . group_by ( k1 ) . having ( ( metric > L ( 10 ) ) ) , sa . select ( [ k1 , metric . label ( 'total' ) ] ) . group_by ( k1 ) . having ( ( F . count ( '*' ) > L ( 100 ) ) ) ] #NEWLINE# for ( case , ex_sqla ) in zip ( cases , expected ) : #NEWLINE# #INDENT# self . _compare_sqla ( case , ex_sqla )