MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_m2m

Method test_m2m

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

Source from the content-addressed store, hash-verified

1862 q = sess.query(Item).with_parent(u1)
1863
1864 def test_m2m(self):
1865 Item, Keyword = self.classes.Item, self.classes.Keyword
1866
1867 sess = fixture_session()
1868 i1 = sess.query(Item).filter_by(id=2).one()
1869 with assertions.expect_deprecated_20(query_wparent_dep):
1870 k = sess.query(Keyword).with_parent(i1).all()
1871 assert [
1872 Keyword(name="red"),
1873 Keyword(name="small"),
1874 Keyword(name="square"),
1875 ] == k
1876
1877 def test_with_transient(self):
1878 User, Order = self.classes.User, self.classes.Order

Callers

nothing calls this directly

Calls 7

fixture_sessionFunction · 0.90
with_parentMethod · 0.80
KeywordClass · 0.70
oneMethod · 0.45
filter_byMethod · 0.45
queryMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected