MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_expanding_in_special_chars

Method test_expanding_in_special_chars

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

Source from the content-addressed store, hash-verified

615
616 @testing.requires.no_quoting_special_bind_names
617 def test_expanding_in_special_chars(self, connection):
618 users = self.tables.users
619 connection.execute(
620 users.insert(),
621 [
622 dict(user_id=7, user_name="jack"),
623 dict(user_id=8, user_name="fred"),
624 ],
625 )
626
627 stmt = (
628 select(users)
629 .where(users.c.user_name.in_(bindparam("u35", expanding=True)))
630 .where(users.c.user_id == bindparam("u46"))
631 .order_by(users.c.user_id)
632 )
633
634 eq_(
635 connection.execute(
636 stmt, {"u35": ["jack", "fred"], "u46": 7}
637 ).fetchall(),
638 [(7, "jack")],
639 )
640
641 stmt = (
642 select(users)
643 .where(users.c.user_name.in_(bindparam("u.35", expanding=True)))
644 .where(users.c.user_id == bindparam("u.46"))
645 .order_by(users.c.user_id)
646 )
647
648 eq_(
649 connection.execute(
650 stmt, {"u.35": ["jack", "fred"], "u.46": 7}
651 ).fetchall(),
652 [(7, "jack")],
653 )
654
655 def test_expanding_in_multiple(self, connection):
656 users = self.tables.users

Callers

nothing calls this directly

Calls 9

selectFunction · 0.90
bindparamFunction · 0.90
eq_Function · 0.90
executeMethod · 0.45
insertMethod · 0.45
order_byMethod · 0.45
whereMethod · 0.45
in_Method · 0.45
fetchallMethod · 0.45

Tested by

no test coverage detected