MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_noparent

Method test_noparent

test/orm/test_deprecations.py:1848–1862  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1846 )
1847
1848 def test_noparent(self):
1849 Item, User = self.classes.Item, self.classes.User
1850
1851 sess = fixture_session()
1852 q = sess.query(User)
1853
1854 u1 = q.filter_by(name="jack").one()
1855
1856 with assertions.expect_deprecated_20(query_wparent_dep):
1857 with assertions.expect_raises_message(
1858 sa_exc.InvalidRequestError,
1859 "Could not locate a property which relates "
1860 "instances of class 'Item' to instances of class 'User'",
1861 ):
1862 q = sess.query(Item).with_parent(u1)
1863
1864 def test_m2m(self):
1865 Item, Keyword = self.classes.Item, self.classes.Keyword

Callers

nothing calls this directly

Calls 5

fixture_sessionFunction · 0.90
with_parentMethod · 0.80
queryMethod · 0.45
oneMethod · 0.45
filter_byMethod · 0.45

Tested by

no test coverage detected