MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_dslish

Method test_dslish

test/orm/test_assorted_eager.py:285–307  ·  view source on GitHub ↗

test the same as withjoinedload except using generative

(self)

Source from the content-addressed store, hash-verified

283 eq_(result_str, ["1 Some Category", "3 Some Category"])
284
285 def test_dslish(self):
286 """test the same as withjoinedload except using generative"""
287
288 Thing, tests, options = (
289 self.classes.Thing,
290 self.tables.tests,
291 self.tables.options,
292 )
293
294 s = fixture_session()
295 q = s.query(Thing).options(sa.orm.joinedload(Thing.category))
296 result = q.filter(
297 sa.and_(
298 tests.c.owner_id == 1,
299 sa.or_(
300 options.c.someoption == None,
301 options.c.someoption == False, # noqa
302 ),
303 )
304 ).outerjoin(Thing.owner_option)
305
306 result_str = ["%d %s" % (t.id, t.category.name) for t in result]
307 eq_(result_str, ["1 Some Category", "3 Some Category"])
308
309 def test_without_outerjoin_literal(self):
310 Thing, tests = (self.classes.Thing, self.tables.tests)

Callers

nothing calls this directly

Calls 9

fixture_sessionFunction · 0.90
eq_Function · 0.90
joinedloadMethod · 0.80
or_Method · 0.80
optionsMethod · 0.45
queryMethod · 0.45
outerjoinMethod · 0.45
filterMethod · 0.45
and_Method · 0.45

Tested by

no test coverage detected