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

Method test_first_against_expression_offset

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

Source from the content-addressed store, hash-verified

2911
2912 @testing.requires.sql_expression_limit_offset
2913 def test_first_against_expression_offset(self):
2914 User = self.classes.User
2915
2916 sess = fixture_session()
2917 q = (
2918 sess.query(User)
2919 .order_by(User.id)
2920 .offset(literal_column("2") + literal_column("3"))
2921 )
2922
2923 self.assert_sql(
2924 testing.db,
2925 q.first,
2926 [
2927 (
2928 "SELECT users.id AS users_id, users.name AS users_name "
2929 "FROM users ORDER BY users.id "
2930 "LIMIT :param_1 OFFSET 2 + 3",
2931 [{"param_1": 1}],
2932 )
2933 ],
2934 )
2935
2936 @testing.requires.sql_expression_limit_offset
2937 def test_full_slice_against_expression_offset(self):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected