MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_outer_join_count

Method test_outer_join_count

test/orm/test_generative.py:302–319  ·  view source on GitHub ↗

test the join and outerjoin functions on Query

(self)

Source from the content-addressed store, hash-verified

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"""
304
305 Order, User, Address = (
306 self.classes.Order,
307 self.classes.User,
308 self.classes.Address,
309 )
310
311 session = fixture_session()
312
313 q = (
314 session.query(User)
315 .outerjoin(User.orders)
316 .outerjoin(Order.addresses)
317 .filter(sa.or_(Order.id == None, Address.id == 1))
318 ) # noqa
319 eq_(q.count(), 4)
320
321 def test_from(self):
322 users, Order, User, Address, orders, addresses = (

Callers

nothing calls this directly

Calls 7

fixture_sessionFunction · 0.90
eq_Function · 0.90
or_Method · 0.80
filterMethod · 0.45
outerjoinMethod · 0.45
queryMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected