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

Method test_load_only_subclass_bound

test/orm/test_deferred.py:1802–1821  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1800 load.fail()
1801
1802 def test_load_only_subclass_bound(self):
1803 s = fixture_session()
1804 q = (
1805 s.query(Manager)
1806 .order_by(Manager.person_id)
1807 .options(
1808 Load(Manager).load_only(Manager.status, Manager.manager_name)
1809 )
1810 )
1811 self.assert_compile(
1812 q,
1813 "SELECT managers.person_id AS managers_person_id, "
1814 "people.person_id AS people_person_id, "
1815 "people.type AS people_type, "
1816 "managers.status AS managers_status, "
1817 "managers.manager_name AS managers_manager_name "
1818 "FROM people JOIN managers "
1819 "ON people.person_id = managers.person_id "
1820 "ORDER BY managers.person_id",
1821 )
1822
1823 def test_load_only_subclass_and_superclass(self):
1824 s = fixture_session()

Callers

nothing calls this directly

Calls 7

fixture_sessionFunction · 0.90
LoadClass · 0.90
load_onlyMethod · 0.80
assert_compileMethod · 0.80
optionsMethod · 0.45
order_byMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected