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

Method test_m2m

test/orm/test_dynamic.py:578–591  ·  view source on GitHub ↗
(self, order_item_fixture)

Source from the content-addressed store, hash-verified

576 eq_(list(u1.addresses), [Address(id=1)])
577
578 def test_m2m(self, order_item_fixture):
579 Order, Item = order_item_fixture(
580 items_args={"backref": backref("orders", lazy="dynamic")}
581 )
582
583 sess = fixture_session()
584 o1 = Order(id=15, description="order 10")
585 i1 = Item(id=10, description="item 8")
586 o1.items.add(i1)
587 sess.add(o1)
588 sess.flush()
589
590 assert o1 in i1.orders.all()
591 assert i1 in o1.items.all()
592
593 def test_association_nonaliased(self):
594 items, Order, orders, order_items, Item = (

Callers

nothing calls this directly

Calls 7

backrefFunction · 0.90
fixture_sessionFunction · 0.90
OrderClass · 0.70
ItemClass · 0.70
addMethod · 0.45
flushMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected