MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_sum

Method test_sum

test/orm/test_query.py:4310–4320  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4308
4309class AggregateTest(QueryTest):
4310 def test_sum(self):
4311 Order = self.classes.Order
4312
4313 sess = fixture_session()
4314 orders = sess.query(Order).filter(Order.id.in_([2, 3, 4]))
4315 eq_(
4316 orders.with_entities(
4317 func.sum(Order.user_id * Order.address_id)
4318 ).scalar(),
4319 79,
4320 )
4321
4322 def test_apply(self):
4323 Order = self.classes.Order

Callers

nothing calls this directly

Calls 8

fixture_sessionFunction · 0.90
eq_Function · 0.90
with_entitiesMethod · 0.80
filterMethod · 0.45
queryMethod · 0.45
in_Method · 0.45
scalarMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected