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

Method test_expanding_in_composite

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

Source from the content-addressed store, hash-verified

745
746 @testing.requires.tuple_in
747 def test_expanding_in_composite(self, connection):
748 users = self.tables.users
749
750 connection.execute(
751 users.insert(),
752 [
753 dict(user_id=7, user_name="jack"),
754 dict(user_id=8, user_name="fred"),
755 dict(user_id=9, user_name=None),
756 ],
757 )
758
759 stmt = (
760 select(users)
761 .where(
762 tuple_(users.c.user_id, users.c.user_name).in_(
763 bindparam("uname", expanding=True)
764 )
765 )
766 .order_by(users.c.user_id)
767 )
768
769 eq_(
770 connection.execute(stmt, {"uname": [(7, "jack")]}).fetchall(),
771 [(7, "jack")],
772 )
773
774 eq_(
775 connection.execute(
776 stmt, {"uname": [(7, "jack"), (8, "fred")]}
777 ).fetchall(),
778 [(7, "jack"), (8, "fred")],
779 )
780
781 def test_expanding_in_dont_alter_compiled(self, connection):
782 """test for issue #5048"""

Callers

nothing calls this directly

Calls 10

selectFunction · 0.90
tuple_Function · 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