MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_sum

Method test_sum

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

Source from the content-addressed store, hash-verified

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