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

Method test_offset_postgres

tests/table/test_objects.py:33–44  ·  view source on GitHub ↗

Postgres can do an offset without a limit clause.

(self)

Source from the content-addressed store, hash-verified

31class TestOffset(DBTestCase):
32 @engines_only("postgres", "cockroach")
33 def test_offset_postgres(self):
34 """
35 Postgres can do an offset without a limit clause.
36 """
37 self.insert_rows()
38
39 response = Band.objects().order_by(Band.name).offset(1).run_sync()
40
41 self.assertEqual(
42 [i.name for i in response],
43 ["Pythonistas", "Rustaceans"],
44 )
45
46 @sqlite_only
47 def test_offset_sqlite(self):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected