MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_update_ordered_custom_key_thing

Method test_update_ordered_custom_key_thing

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

Source from the content-addressed store, hash-verified

210 )
211
212 def test_update_ordered_custom_key_thing(self):
213 table1 = self.tables.mytable
214
215 class Thing:
216 def __clause_element__(self):
217 return table1.c.name
218
219 stmt = (
220 table1.update()
221 .ordered_values((Thing(), "jack"))
222 .where(table1.c.name == "jill")
223 )
224
225 self.assert_compile(
226 stmt,
227 "UPDATE mytable SET name='jack' WHERE mytable.name = 'jill'",
228 literal_binds=True,
229 )
230
231 def test_update_broken_custom_key_thing(self):
232 table1 = self.tables.mytable

Callers

nothing calls this directly

Calls 5

ordered_valuesMethod · 0.80
assert_compileMethod · 0.80
ThingClass · 0.70
whereMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected