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

Method test_offset_sqlite

tests/table/test_objects.py:47–63  ·  view source on GitHub ↗

SQLite requires a limit clause for offset to work.

(self)

Source from the content-addressed store, hash-verified

45
46 @sqlite_only
47 def test_offset_sqlite(self):
48 """
49 SQLite requires a limit clause for offset to work.
50 """
51 self.insert_rows()
52 query = Band.objects().order_by(Band.name).offset(1)
53
54 with self.assertRaises(ValueError):
55 query.run_sync()
56
57 query = query.limit(5)
58
59 response = query.run_sync()
60
61 self.assertEqual(
62 [i.name for i in response], ["Pythonistas", "Rustaceans"]
63 )
64
65
66class TestGet(DBTestCase):

Callers

nothing calls this directly

Calls 7

objectsMethod · 0.80
assertEqualMethod · 0.80
insert_rowsMethod · 0.45
offsetMethod · 0.45
order_byMethod · 0.45
run_syncMethod · 0.45
limitMethod · 0.45

Tested by

no test coverage detected