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

Method test_ilike

test/sql/test_query.py:230–272  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

228 eq_(connection.scalar(expr), result)
229
230 def test_ilike(self, connection):
231 users = self.tables.users
232 connection.execute(
233 users.insert(),
234 [
235 {"user_id": 1, "user_name": "one"},
236 {"user_id": 2, "user_name": "TwO"},
237 {"user_id": 3, "user_name": "ONE"},
238 {"user_id": 4, "user_name": "OnE"},
239 ],
240 )
241
242 eq_(
243 connection.execute(
244 select(users.c.user_id).where(users.c.user_name.ilike("one"))
245 ).fetchall(),
246 [(1,), (3,), (4,)],
247 )
248
249 eq_(
250 connection.execute(
251 select(users.c.user_id).where(users.c.user_name.ilike("TWO"))
252 ).fetchall(),
253 [(2,)],
254 )
255
256 if testing.against("postgresql"):
257 eq_(
258 connection.execute(
259 select(users.c.user_id).where(
260 users.c.user_name.like("one")
261 )
262 ).fetchall(),
263 [(1,)],
264 )
265 eq_(
266 connection.execute(
267 select(users.c.user_id).where(
268 users.c.user_name.like("TWO")
269 )
270 ).fetchall(),
271 [],
272 )
273
274 def test_compiled_execute(self, connection):
275 users = self.tables.users

Callers

nothing calls this directly

Calls 9

eq_Function · 0.90
selectFunction · 0.90
executeMethod · 0.45
insertMethod · 0.45
fetchallMethod · 0.45
whereMethod · 0.45
ilikeMethod · 0.45
againstMethod · 0.45
likeMethod · 0.45

Tested by

no test coverage detected