MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_column_queries_eight

Method test_column_queries_eight

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

Source from the content-addressed store, hash-verified

2022 )
2023
2024 def test_column_queries_eight(self):
2025 Address, User = (
2026 self.classes.Address,
2027 self.classes.User,
2028 )
2029
2030 sess = fixture_session()
2031 adalias = aliased(Address)
2032 eq_(
2033 sess.query(func.count(adalias.email_address), User)
2034 .outerjoin(adalias, User.addresses)
2035 .group_by(User)
2036 .order_by(User.id)
2037 .all(),
2038 [
2039 (1, User(name="jack", id=7)),
2040 (3, User(name="ed", id=8)),
2041 (1, User(name="fred", id=9)),
2042 (0, User(name="chuck", id=10)),
2043 ],
2044 )
2045
2046 def test_column_queries_nine(self):
2047 Address, User = (

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected