MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_issue_5470_four

Method test_issue_5470_four

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

Source from the content-addressed store, hash-verified

4707 )
4708
4709 def test_issue_5470_four(self):
4710 User = self.classes.User
4711
4712 expr = (User.id + literal(1)).label("label")
4713
4714 sess = fixture_session()
4715 q = (
4716 sess.query(expr)
4717 .select_from(User)
4718 .order_by(asc("label"))
4719 .distinct()
4720 )
4721
4722 # no double col in the select list,
4723 # orders by the label
4724 self.assert_compile(
4725 q,
4726 "SELECT DISTINCT users.id + :param_1 AS label "
4727 "FROM users ORDER BY label ASC",
4728 )
4729
4730 def test_issue_5470_five(self):
4731 User = self.classes.User

Callers

nothing calls this directly

Calls 9

literalFunction · 0.90
fixture_sessionFunction · 0.90
ascFunction · 0.90
assert_compileMethod · 0.80
labelMethod · 0.45
distinctMethod · 0.45
order_byMethod · 0.45
select_fromMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected