MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_outer_join

Method test_outer_join

test/orm/test_generative.py:284–300  ·  view source on GitHub ↗

Query.outerjoin

(self)

Source from the content-addressed store, hash-verified

282 eq_([User(id=7)], q.all())
283
284 def test_outer_join(self):
285 """Query.outerjoin"""
286
287 Order, User, Address = (
288 self.classes.Order,
289 self.classes.User,
290 self.classes.Address,
291 )
292
293 session = fixture_session()
294 q = (
295 session.query(User)
296 .outerjoin(User.orders)
297 .outerjoin(Order.addresses)
298 .filter(sa.or_(Order.id == None, Address.id == 1))
299 ) # noqa
300 eq_({User(id=7), User(id=8), User(id=10)}, set(q.all()))
301
302 def test_outer_join_count(self):
303 """test the join and outerjoin functions on Query"""

Callers

nothing calls this directly

Calls 8

fixture_sessionFunction · 0.90
eq_Function · 0.90
or_Method · 0.80
UserClass · 0.70
filterMethod · 0.45
outerjoinMethod · 0.45
queryMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected