MCPcopy Create free account
hub / github.com/piccolo-orm/piccolo / test_replace

Method test_replace

tests/columns/test_array.py:254–267  ·  view source on GitHub ↗

Make sure values can be swapped in the array.

(self)

Source from the content-addressed store, hash-verified

252
253 @engines_skip("sqlite")
254 def test_replace(self):
255 """
256 Make sure values can be swapped in the array.
257 """
258 MyTable(value=[1, 1, 1]).save().run_sync()
259
260 MyTable.update(
261 {MyTable.value: MyTable.value.replace(1, 2)}, force=True
262 ).run_sync()
263
264 self.assertEqual(
265 MyTable.select(MyTable.value).run_sync(),
266 [{"value": [2, 2, 2]}],
267 )
268
269 @sqlite_only
270 def test_replace_sqlite(self):

Callers

nothing calls this directly

Calls 7

saveMethod · 0.80
updateMethod · 0.80
replaceMethod · 0.80
assertEqualMethod · 0.80
selectMethod · 0.80
MyTableClass · 0.70
run_syncMethod · 0.45

Tested by

no test coverage detected