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

Method test_issue_5470_four

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

Source from the content-addressed store, hash-verified

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