MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_join_against_join

Method test_join_against_join

test/sql/test_selectable.py:910–921  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

908 )
909
910 def test_join_against_join(self):
911 j = outerjoin(table1, table2, table1.c.col1 == table2.c.col2)
912 jj = (
913 select(table1.c.col1.label("bar_col1"))
914 .select_from(j)
915 .alias(name="foo")
916 )
917 jjj = join(table1, jj, table1.c.col1 == jj.c.bar_col1)
918 assert jjj.corresponding_column(jjj.c.table1_col1) is jjj.c.table1_col1
919 j2 = jjj._anonymous_fromclause("foo")
920 assert j2.corresponding_column(jjj.c.table1_col1) is j2.c.table1_col1
921 assert jjj.corresponding_column(jj.c.bar_col1) is jj.c.bar_col1
922
923 def test_table_alias(self):
924 a = table1.alias("a")

Callers

nothing calls this directly

Calls 8

outerjoinFunction · 0.90
selectFunction · 0.90
joinFunction · 0.90
aliasMethod · 0.45
select_fromMethod · 0.45
labelMethod · 0.45
corresponding_columnMethod · 0.45
_anonymous_fromclauseMethod · 0.45

Tested by

no test coverage detected