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

Method test_m2m

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

Source from the content-addressed store, hash-verified

548 )
549
550 def test_m2m(self, order_item_fixture):
551 Order, Item = order_item_fixture(
552 items_args={"backref": backref("orders", lazy="dynamic")}
553 )
554
555 sess = fixture_session()
556 o1 = Order(id=15, description="order 10")
557 i1 = Item(id=10, description="item 8")
558 o1.items.add(i1)
559 sess.add(o1)
560 sess.flush()
561
562 assert o1 in i1.orders.all()
563 assert i1 in o1.items.all()
564
565 def test_association_nonaliased(self):
566 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