MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_update_statement

Method test_update_statement

test/sql/test_lambdas.py:1902–1918  ·  view source on GitHub ↗
(self, user_address_fixture)

Source from the content-addressed store, hash-verified

1900 )
1901
1902 def test_update_statement(self, user_address_fixture):
1903 users, addresses = user_address_fixture
1904
1905 def upd(id_, newname):
1906 stmt = lambda_stmt(lambda: users.update())
1907 stmt += lambda s: s.values(name=newname)
1908 stmt += lambda s: s.where(users.c.id == id_)
1909 return stmt
1910
1911 with testing.db.begin() as conn:
1912 conn.execute(users.insert().values(id=7, name="bar"))
1913 conn.execute(upd(7, "foo"))
1914
1915 eq_(
1916 conn.execute(select(users).where(users.c.id == 7)).first(),
1917 (7, "foo"),
1918 )
1919
1920 def test_bindparam_not_cached(self, user_address_fixture, testing_engine):
1921 """test #12084"""

Callers

nothing calls this directly

Calls 8

eq_Function · 0.90
selectFunction · 0.90
beginMethod · 0.45
executeMethod · 0.45
valuesMethod · 0.45
insertMethod · 0.45
firstMethod · 0.45
whereMethod · 0.45

Tested by

no test coverage detected