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

Method test_query_four

test/ext/test_hybrid.py:2170–2181  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2168 )
2169
2170 def test_query_four(self):
2171 BankAccount = self.BankAccount
2172 session = fixture_session()
2173
2174 # 4c. query all amounts, converting to "CAD" on the DB side
2175 query = session.query(BankAccount.balance.as_currency("cad").amount)
2176 self.assert_compile(
2177 query,
2178 "SELECT :balance_1 * bank_account.balance AS anon_1 "
2179 "FROM bank_account",
2180 checkparams={"balance_1": Decimal("1.01152")},
2181 )
2182
2183 def test_query_five(self):
2184 BankAccount = self.BankAccount

Callers

nothing calls this directly

Calls 4

fixture_sessionFunction · 0.90
as_currencyMethod · 0.80
assert_compileMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected