#NEWLINE# def test_cte_factor_distinct_but_equal( self ) : #NEWLINE# #INDENT# expr = self . _case_cte_factor_distinct_but_equal ( ) #NEWLINE# result = to_sql ( expr ) #NEWLINE# expected = 'WITH t0 AS (\n  SELECT `g`, sum(`f`) AS `metric`\n  FROM alltypes\n  GROUP BY 1\n)\nSELECT t0.*\nFROM t0\n  INNER JOIN t0 t1\n    ON t0.`g` = t1.`g`' #NEWLINE# assert ( result == expected )