MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_full_slice_against_integer_offset

Method test_full_slice_against_integer_offset

test/orm/test_query.py:2960–2977  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2958 )
2959
2960 def test_full_slice_against_integer_offset(self):
2961 User = self.classes.User
2962
2963 sess = fixture_session()
2964 q = sess.query(User).order_by(User.id).offset(2)
2965
2966 self.assert_sql(
2967 testing.db,
2968 lambda: q[2:5],
2969 [
2970 (
2971 "SELECT users.id AS users_id, users.name AS users_name "
2972 "FROM users ORDER BY users.id "
2973 "LIMIT :param_1 OFFSET :param_2",
2974 [{"param_1": 3, "param_2": 4}],
2975 )
2976 ],
2977 )
2978
2979 @testing.requires.sql_expression_limit_offset
2980 def test_start_slice_against_expression_offset(self):

Callers

nothing calls this directly

Calls 5

fixture_sessionFunction · 0.90
assert_sqlMethod · 0.80
offsetMethod · 0.45
order_byMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected