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

Method test_m2m

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

Source from the content-addressed store, hash-verified

6046 )
6047
6048 def test_m2m(self):
6049 Item, Keyword = self.classes.Item, self.classes.Keyword
6050
6051 sess = fixture_session()
6052 i1 = sess.query(Item).filter_by(id=2).one()
6053 k = sess.query(Keyword).filter(with_parent(i1, Item.keywords)).all()
6054 eq_(
6055 k,
6056 [
6057 Keyword(name="red"),
6058 Keyword(name="small"),
6059 Keyword(name="square"),
6060 ],
6061 )
6062
6063 def test_with_transient(self):
6064 User, Order = self.classes.User, self.classes.Order

Callers

nothing calls this directly

Calls 9

fixture_sessionFunction · 0.90
with_parentFunction · 0.90
eq_Function · 0.90
KeywordClass · 0.70
oneMethod · 0.45
filter_byMethod · 0.45
queryMethod · 0.45
allMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected