MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_from

Method test_from

test/orm/test_generative.py:321–341  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

319 eq_(q.count(), 4)
320
321 def test_from(self):
322 users, Order, User, Address, orders, addresses = (
323 self.tables.users,
324 self.classes.Order,
325 self.classes.User,
326 self.classes.Address,
327 self.tables.orders,
328 self.tables.addresses,
329 )
330
331 session = fixture_session()
332
333 sel = users.outerjoin(orders).outerjoin(
334 addresses, orders.c.address_id == addresses.c.id
335 )
336 q = (
337 session.query(User)
338 .select_from(sel)
339 .filter(sa.or_(Order.id == None, Address.id == 1))
340 ) # noqa
341 eq_({User(id=7), User(id=8), User(id=10)}, set(q.all()))
342
343
344class CaseSensitiveTest(fixtures.MappedTest):

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected