MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_slice_access

Method test_slice_access

test/orm/test_dynamic.py:194–203  ·  view source on GitHub ↗
(self, user_address_fixture)

Source from the content-addressed store, hash-verified

192 )
193
194 def test_slice_access(self, user_address_fixture):
195 User, Address = user_address_fixture()
196
197 sess = fixture_session()
198 u1 = sess.get(User, 8)
199
200 eq_(u1.addresses.limit(1).one(), Address(id=2))
201
202 eq_(u1.addresses[0], Address(id=2))
203 eq_(u1.addresses[0:2], [Address(id=2), Address(id=3)])
204
205 def test_negative_slice_access_raises(self, user_address_fixture):
206 User, Address = user_address_fixture()

Callers

nothing calls this directly

Calls 6

fixture_sessionFunction · 0.90
eq_Function · 0.90
AddressClass · 0.70
getMethod · 0.45
oneMethod · 0.45
limitMethod · 0.45

Tested by

no test coverage detected