MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_from_bound_col_value

Method test_from_bound_col_value

test/sql/test_update.py:1031–1051  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1029 __dialect__ = "default_enhanced"
1030
1031 def test_from_bound_col_value(self):
1032 mytable = self.tables.mytable
1033
1034 # from_dml_column() refers to another column in SET, then the
1035 # same parameter is rendered
1036 stmt = mytable.update().values(
1037 name="some name", description=from_dml_column(mytable.c.name)
1038 )
1039
1040 self.assert_compile(
1041 stmt,
1042 "UPDATE mytable SET name=:name, description=:name",
1043 checkparams={"name": "some name"},
1044 )
1045
1046 self.assert_compile(
1047 stmt,
1048 "UPDATE mytable SET name=?, description=?",
1049 checkpositional=("some name", "some name"),
1050 dialect="sqlite",
1051 )
1052
1053 def test_from_static_col_value(self):
1054 mytable = self.tables.mytable

Callers

nothing calls this directly

Calls 4

from_dml_columnFunction · 0.90
assert_compileMethod · 0.80
valuesMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected