MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_column_queries_seven

Method test_column_queries_seven

test/orm/test_froms.py:2002–2022  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2000 )
2001
2002 def test_column_queries_seven(self):
2003 Address, User = (
2004 self.classes.Address,
2005 self.classes.User,
2006 )
2007
2008 sess = fixture_session()
2009 adalias = aliased(Address)
2010 eq_(
2011 sess.query(User, func.count(adalias.email_address))
2012 .outerjoin(User.addresses.of_type(adalias))
2013 .group_by(User)
2014 .order_by(User.id)
2015 .all(),
2016 [
2017 (User(name="jack", id=7), 1),
2018 (User(name="ed", id=8), 3),
2019 (User(name="fred", id=9), 1),
2020 (User(name="chuck", id=10), 0),
2021 ],
2022 )
2023
2024 def test_column_queries_eight(self):
2025 Address, User = (

Callers

nothing calls this directly

Calls 11

fixture_sessionFunction · 0.90
aliasedFunction · 0.90
eq_Function · 0.90
UserClass · 0.70
allMethod · 0.45
order_byMethod · 0.45
group_byMethod · 0.45
outerjoinMethod · 0.45
queryMethod · 0.45
countMethod · 0.45
of_typeMethod · 0.45

Tested by

no test coverage detected