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