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

Method test_append

tests/columns/test_array.py:225–238  ·  view source on GitHub ↗

Make sure values can be appended to an array.

(self)

Source from the content-addressed store, hash-verified

223
224 @engines_skip("sqlite")
225 def test_append(self):
226 """
227 Make sure values can be appended to an array.
228 """
229 MyTable(value=[1, 1, 1]).save().run_sync()
230
231 MyTable.update(
232 {MyTable.value: MyTable.value.append(3)}, force=True
233 ).run_sync()
234
235 self.assertEqual(
236 MyTable.select(MyTable.value).run_sync(),
237 [{"value": [1, 1, 1, 3]}],
238 )
239
240 @sqlite_only
241 def test_append_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
appendMethod · 0.45

Tested by

no test coverage detected