MCPcopy Index your code
hub / github.com/piccolo-orm/piccolo / test_remove

Method test_remove

tests/columns/test_array.py:283–296  ·  view source on GitHub ↗

Make sure values can be removed from an array.

(self)

Source from the content-addressed store, hash-verified

281
282 @engines_skip("sqlite")
283 def test_remove(self):
284 """
285 Make sure values can be removed from an array.
286 """
287 MyTable(value=[1, 2, 3]).save().run_sync()
288
289 MyTable.update(
290 {MyTable.value: MyTable.value.remove(2)}, force=True
291 ).run_sync()
292
293 self.assertEqual(
294 MyTable.select(MyTable.value).run_sync(),
295 [{"value": [1, 3]}],
296 )
297
298 @sqlite_only
299 def test_remove_sqlite(self):

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected