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

Method test_with_transient

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

Source from the content-addressed store, hash-verified

2734 ] == k
2735
2736 def test_with_transient(self):
2737 User, Order = self.classes.User, self.classes.Order
2738
2739 sess = fixture_session()
2740
2741 q = sess.query(User)
2742 u1 = q.filter_by(name="jack").one()
2743 utrans = User(id=u1.id)
2744 with assertions.expect_deprecated_20(query_wparent_dep):
2745 o = sess.query(Order).with_parent(utrans, User.orders)
2746 eq_(
2747 [
2748 Order(description="order 1"),
2749 Order(description="order 3"),
2750 Order(description="order 5"),
2751 ],
2752 o.all(),
2753 )
2754
2755 def test_with_pending_autoflush(self):
2756 Order, User = self.classes.Order, self.classes.User

Callers

nothing calls this directly

Calls 9

fixture_sessionFunction · 0.90
eq_Function · 0.90
with_parentMethod · 0.80
UserClass · 0.70
OrderClass · 0.70
queryMethod · 0.45
oneMethod · 0.45
filter_byMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected