MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_outerjoin_x2

Method test_outerjoin_x2

test/sql/test_query.py:1496–1508  ·  view source on GitHub ↗

Outer joins t1->t2,t3.

(self)

Source from the content-addressed store, hash-verified

1494 self.assertRows(expr, [(10, 20)])
1495
1496 def test_outerjoin_x2(self):
1497 """Outer joins t1->t2,t3."""
1498 t1, t2, t3 = self.tables("t1", "t2", "t3")
1499
1500 for criteria in (t2.c.t2_id == t3.c.t2_id, t3.c.t2_id == t2.c.t2_id):
1501 expr = select(t1.c.t1_id, t2.c.t2_id, t3.c.t3_id).select_from(
1502 t1.outerjoin(t2, t1.c.t1_id == t2.c.t1_id).outerjoin(
1503 t3, criteria
1504 )
1505 )
1506 self.assertRows(
1507 expr, [(10, 20, 30), (11, 21, None), (12, None, None)]
1508 )
1509
1510 def test_outerjoin_where_x2_t1(self):
1511 """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