MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_withoutjoinedload

Method test_withoutjoinedload

test/orm/test_assorted_eager.py:214–245  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

212 eq_(result, [(1, "Some Category"), (3, "Some Category")])
213
214 def test_withoutjoinedload(self):
215 Thing, tests, options = (
216 self.classes.Thing,
217 self.tables.tests,
218 self.tables.options,
219 )
220
221 s = fixture_session()
222 result = (
223 s.query(Thing)
224 .select_from(
225 tests.outerjoin(
226 options,
227 sa.and_(
228 tests.c.id == options.c.test_id,
229 tests.c.owner_id == options.c.owner_id,
230 ),
231 )
232 )
233 .filter(
234 sa.and_(
235 tests.c.owner_id == 1,
236 sa.or_(
237 options.c.someoption == None, # noqa
238 options.c.someoption == False,
239 ),
240 )
241 )
242 )
243
244 result_str = ["%d %s" % (t.id, t.category.name) for t in result]
245 eq_(result_str, ["1 Some Category", "3 Some Category"])
246
247 def test_withjoinedload(self):
248 """

Callers

nothing calls this directly

Calls 8

fixture_sessionFunction · 0.90
eq_Function · 0.90
or_Method · 0.80
filterMethod · 0.45
select_fromMethod · 0.45
queryMethod · 0.45
outerjoinMethod · 0.45
and_Method · 0.45

Tested by

no test coverage detected