MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_multi_bundle

Method test_multi_bundle

test/orm/test_bundle.py:345–371  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

343 )
344
345 def test_multi_bundle(self):
346 Data = self.classes.Data
347 Other = self.classes.Other
348
349 d1 = aliased(Data)
350
351 b1 = Bundle("b1", d1.d1, d1.d2)
352 b2 = Bundle("b2", Data.d1, Other.o1)
353
354 sess = fixture_session()
355
356 q = (
357 sess.query(b1, b2)
358 .join(Data.others)
359 .join(d1, d1.id == Data.id)
360 .filter(b1.c.d1 == "d3d1")
361 )
362 eq_(
363 q.all(),
364 [
365 (("d3d1", "d3d2"), ("d3d1", "d3o0")),
366 (("d3d1", "d3d2"), ("d3d1", "d3o1")),
367 (("d3d1", "d3d2"), ("d3d1", "d3o2")),
368 (("d3d1", "d3d2"), ("d3d1", "d3o3")),
369 (("d3d1", "d3d2"), ("d3d1", "d3o4")),
370 ],
371 )
372
373 def test_multi_bundle_future(self):
374 Data = self.classes.Data

Callers

nothing calls this directly

Calls 8

aliasedFunction · 0.90
BundleClass · 0.90
fixture_sessionFunction · 0.90
eq_Function · 0.90
filterMethod · 0.45
joinMethod · 0.45
queryMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected