Test the interaction between limit and offset
(self, connection)
| 1009 | |
| 1010 | @testing.requires.offset |
| 1011 | def test_select_limit_offset(self, connection): |
| 1012 | """Test the interaction between limit and offset""" |
| 1013 | |
| 1014 | users, addresses = self.tables("users", "addresses") |
| 1015 | |
| 1016 | r = connection.execute( |
| 1017 | users.select().limit(3).offset(2).order_by(users.c.user_id) |
| 1018 | ).fetchall() |
| 1019 | self.assert_(r == [(3, "ed"), (4, "wendy"), (5, "laura")]) |
| 1020 | r = connection.execute( |
| 1021 | users.select().offset(5).order_by(users.c.user_id) |
| 1022 | ).fetchall() |
| 1023 | self.assert_(r == [(6, "ralph"), (7, "fido")]) |
| 1024 | |
| 1025 | def test_select_distinct_limit(self, connection): |
| 1026 | """Test the interaction between limit and distinct""" |