MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_from_bound_col_value

Method test_from_bound_col_value

test/sql/test_insert.py:1206–1226  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1204 __dialect__ = "default_enhanced"
1205
1206 def test_from_bound_col_value(self):
1207 mytable = self.tables.mytable
1208
1209 # from_dml_column() refers to another column in SET, then the
1210 # same parameter is rendered
1211 stmt = mytable.insert().values(
1212 name="some name", description=from_dml_column(mytable.c.name)
1213 )
1214
1215 self.assert_compile(
1216 stmt,
1217 "INSERT INTO mytable (name, description) VALUES (:name, :name)",
1218 checkparams={"name": "some name"},
1219 )
1220
1221 self.assert_compile(
1222 stmt,
1223 "INSERT INTO mytable (name, description) VALUES (?, ?)",
1224 checkpositional=("some name", "some name"),
1225 dialect="sqlite",
1226 )
1227
1228 def test_from_static_col_value(self):
1229 mytable = self.tables.mytable

Callers

nothing calls this directly

Calls 4

from_dml_columnFunction · 0.90
assert_compileMethod · 0.80
valuesMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected