MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_in_27

Method test_in_27

test/sql/test_operators.py:2473–2500  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2471 )
2472
2473 def test_in_27(self):
2474 # test that putting a select in an IN clause does not
2475 # blow away its ORDER BY clause
2476 self.assert_compile(
2477 select(self.table1, self.table2)
2478 .where(
2479 self.table2.c.otherid.in_(
2480 select(self.table2.c.otherid)
2481 .order_by(self.table2.c.othername)
2482 .limit(10)
2483 .correlate(False),
2484 )
2485 )
2486 .select_from(
2487 self.table1.join(
2488 self.table2,
2489 self.table1.c.myid == self.table2.c.otherid,
2490 )
2491 )
2492 .order_by(self.table1.c.myid),
2493 "SELECT mytable.myid, "
2494 "myothertable.otherid, myothertable.othername FROM mytable "
2495 "JOIN myothertable ON mytable.myid = myothertable.otherid "
2496 "WHERE myothertable.otherid IN (SELECT myothertable.otherid "
2497 "FROM myothertable ORDER BY myothertable.othername "
2498 "LIMIT :param_1) ORDER BY mytable.myid",
2499 {"param_1": 10},
2500 )
2501
2502 def test_in_28(self):
2503 """revised to test #12314"""

Callers

nothing calls this directly

Calls 9

selectFunction · 0.85
assert_compileMethod · 0.80
order_byMethod · 0.45
select_fromMethod · 0.45
whereMethod · 0.45
in_Method · 0.45
correlateMethod · 0.45
limitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected