MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_in_joinedload

Method test_in_joinedload

test/orm/test_deferred.py:2328–2342  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2326 eq_(a1.all(), [A(my_expr=12), A(my_expr=15)])
2327
2328 def test_in_joinedload(self):
2329 A, B = self.classes("A", "B")
2330
2331 s = fixture_session()
2332
2333 q = (
2334 s.query(A)
2335 .options(joinedload(A.bs).with_expression(B.b_expr, B.p * A.x))
2336 .filter(A.id.in_([3, 4]))
2337 .order_by(A.id)
2338 )
2339
2340 eq_(
2341 q.all(), [A(bs=[B(b_expr=25)]), A(bs=[B(b_expr=38), B(b_expr=10)])]
2342 )
2343
2344 def test_no_refresh_unless_populate_existing(self):
2345 A = self.classes.A

Callers

nothing calls this directly

Calls 12

fixture_sessionFunction · 0.90
joinedloadFunction · 0.90
eq_Function · 0.90
with_expressionMethod · 0.80
AClass · 0.70
BClass · 0.70
order_byMethod · 0.45
filterMethod · 0.45
optionsMethod · 0.45
queryMethod · 0.45
in_Method · 0.45
allMethod · 0.45

Tested by

no test coverage detected