MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_issue_5470_three

Method test_issue_5470_three

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

Source from the content-addressed store, hash-verified

4691 )
4692
4693 def test_issue_5470_three(self):
4694 User = self.classes.User
4695
4696 expr = (User.id + literal(1)).label("label")
4697
4698 sess = fixture_session()
4699 q = sess.query(expr).select_from(User).order_by(asc(expr)).distinct()
4700
4701 # no double col in the select list,
4702 # orders by the label
4703 self.assert_compile(
4704 q,
4705 "SELECT DISTINCT users.id + :param_1 AS label "
4706 "FROM users ORDER BY label ASC",
4707 )
4708
4709 def test_issue_5470_four(self):
4710 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