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

Method test_issue_5470_two

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

Source from the content-addressed store, hash-verified

4673 )
4674
4675 def test_issue_5470_two(self):
4676 User = self.classes.User
4677
4678 expr = User.id + literal(1)
4679
4680 sess = fixture_session()
4681 q = sess.query(expr).select_from(User).order_by(asc(expr)).distinct()
4682
4683 # no double col in the select list,
4684 # there's no label so this is the requested SQL
4685 self.assert_compile(
4686 q,
4687 "SELECT DISTINCT users.id + :param_1 AS anon_1 "
4688 "FROM users ORDER BY users.id + :param_1 ASC",
4689 )
4690
4691 def test_issue_5470_three(self):
4692 User = self.classes.User

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected