MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_mixed

Method test_mixed

test/sql/test_query.py:1681–1690  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

1679 self.assertRows(expr, [(10, 20, 30)])
1680
1681 def test_mixed(self):
1682 """Joins t1->t2, outer t2->t3."""
1683 t1, t2, t3 = self.tables("t1", "t2", "t3")
1684
1685 for criteria in (t2.c.t2_id == t3.c.t2_id, t3.c.t2_id == t2.c.t2_id):
1686 expr = select(t1.c.t1_id, t2.c.t2_id, t3.c.t3_id).select_from(
1687 (t1.join(t2).outerjoin(t3, criteria)),
1688 )
1689 print(expr)
1690 self.assertRows(expr, [(10, 20, 30), (11, 21, None)])
1691
1692 def test_mixed_where(self):
1693 """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