MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_issue_5470_two

Method test_issue_5470_two

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

Source from the content-addressed store, hash-verified

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