Skip to content

Commit a282cd2

Browse files
committed
update to use Label to cover changed code in test
1 parent 126fecc commit a282cd2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_loader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,15 @@ async def test_multiple_models_in_one_query(bind):
179179

180180

181181
async def test_loader_with_aggregation(user):
182+
count_col = count().label('count')
182183
user_count = select(
183-
[User.team_id, count().label('count')]
184+
[User.team_id, count_col]
184185
).group_by(
185186
User.team_id
186187
).alias()
187188
query = Team.outerjoin(user_count).select()
188189
result = await query.gino.load(
189-
(Team.id, Team.name, user_count.columns.team_id, ColumnLoader('count'))
190+
(Team.id, Team.name, user_count.columns.team_id, count_col)
190191
).all()
191192
assert len(result) == 2
192193
# team 1 doesn't have users, team 2 has 1 user

0 commit comments

Comments
 (0)