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

Method test_mixed

test/sql/test_query.py:1749–1758  ·  view source on GitHub ↗

Joins t1->t2, outer t2->t3.

(self)

Source from the content-addressed store, hash-verified

1747 self.assertRows(expr, [(10, 20, 30)])
1748
1749 def test_mixed(self):
1750 """Joins t1->t2, outer t2->t3."""
1751 t1, t2, t3 = self.tables("t1", "t2", "t3")
1752
1753 for criteria in (t2.c.t2_id == t3.c.t2_id, t3.c.t2_id == t2.c.t2_id):
1754 expr = select(t1.c.t1_id, t2.c.t2_id, t3.c.t3_id).select_from(
1755 (t1.join(t2).outerjoin(t3, criteria)),
1756 )
1757 print(expr)
1758 self.assertRows(expr, [(10, 20, 30), (11, 21, None)])
1759
1760 def test_mixed_where(self):
1761 """Joins t1->t2, outer t2->t3, plus a where on each table in turn."""

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected