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

Method test_query_three

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

Source from the content-addressed store, hash-verified

2146 )
2147
2148 def test_query_three(self):
2149 BankAccount = self.BankAccount
2150 session = fixture_session()
2151
2152 query = session.query(BankAccount).filter(
2153 BankAccount.balance.as_currency("cad")
2154 > BankAccount.balance.as_currency("eur")
2155 )
2156 self.assert_compile(
2157 query,
2158 "SELECT bank_account.id AS bank_account_id, "
2159 "bank_account.balance AS bank_account_balance "
2160 "FROM bank_account "
2161 "WHERE :balance_1 * bank_account.balance > "
2162 ":param_1 * :balance_2 * bank_account.balance",
2163 checkparams={
2164 "balance_1": Decimal("1.01152"),
2165 "balance_2": Decimal("0.724743"),
2166 "param_1": Decimal("1.39569"),
2167 },
2168 )
2169
2170 def test_query_four(self):
2171 BankAccount = self.BankAccount

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected