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

Method test_prepend

tests/columns/test_array.py:196–209  ·  view source on GitHub ↗

Make sure values can be added to the beginning of the array.

(self)

Source from the content-addressed store, hash-verified

194
195 @engines_skip("sqlite")
196 def test_prepend(self):
197 """
198 Make sure values can be added to the beginning of the array.
199 """
200 MyTable(value=[1, 1, 1]).save().run_sync()
201
202 MyTable.update(
203 {MyTable.value: MyTable.value.prepend(3)}, force=True
204 ).run_sync()
205
206 self.assertEqual(
207 MyTable.select(MyTable.value).run_sync(),
208 [{"value": [3, 1, 1, 1]}],
209 )
210
211 @sqlite_only
212 def test_prepend_sqlite(self):

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected