MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_outerjoin_x2

Method test_outerjoin_x2

test/sql/test_query.py:1564–1576  ·  view source on GitHub ↗

Outer joins t1->t2,t3.

(self)

Source from the content-addressed store, hash-verified

1562 self.assertRows(expr, [(10, 20)])
1563
1564 def test_outerjoin_x2(self):
1565 """Outer joins t1->t2,t3."""
1566 t1, t2, t3 = self.tables("t1", "t2", "t3")
1567
1568 for criteria in (t2.c.t2_id == t3.c.t2_id, t3.c.t2_id == t2.c.t2_id):
1569 expr = select(t1.c.t1_id, t2.c.t2_id, t3.c.t3_id).select_from(
1570 t1.outerjoin(t2, t1.c.t1_id == t2.c.t1_id).outerjoin(
1571 t3, criteria
1572 )
1573 )
1574 self.assertRows(
1575 expr, [(10, 20, 30), (11, 21, None), (12, None, None)]
1576 )
1577
1578 def test_outerjoin_where_x2_t1(self):
1579 """Outer joins t1->t2,t3, where on t1."""

Callers

nothing calls this directly

Calls 4

assertRowsMethod · 0.95
selectFunction · 0.90
select_fromMethod · 0.45
outerjoinMethod · 0.45

Tested by

no test coverage detected