MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_clauses

Method test_clauses

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

Source from the content-addressed store, hash-verified

2018 )
2019
2020 def test_clauses(self):
2021 User, Address = self.classes.User, self.classes.Address
2022
2023 for expr, compare in (
2024 (func.max(User.id), "max(users.id)"),
2025 (User.id.desc(), "users.id DESC"),
2026 (
2027 between(5, User.id, Address.id),
2028 ":param_1 BETWEEN users.id AND addresses.id",
2029 ),
2030 # this one would require adding compile() to
2031 # InstrumentedScalarAttribute. do we want this ?
2032 # (User.id, "users.id")
2033 ):
2034 c = expr.compile(dialect=default.DefaultDialect())
2035 assert str(c) == compare, "%s != %s" % (str(c), compare)
2036
2037
2038class ExpressionTest(QueryTest, AssertsCompiledSQL):

Callers

nothing calls this directly

Calls 4

betweenFunction · 0.90
maxMethod · 0.80
descMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected