MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_with_transient

Method test_with_transient

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

Source from the content-addressed store, hash-verified

6061 )
6062
6063 def test_with_transient(self):
6064 User, Order = self.classes.User, self.classes.Order
6065
6066 sess = fixture_session()
6067
6068 q = sess.query(User)
6069 u1 = q.filter_by(name="jack").one()
6070 utrans = User(id=u1.id)
6071 o = sess.query(Order).filter(with_parent(utrans, User.orders))
6072 eq_(
6073 [
6074 Order(description="order 1"),
6075 Order(description="order 3"),
6076 Order(description="order 5"),
6077 ],
6078 o.all(),
6079 )
6080
6081 def test_with_pending_autoflush(self):
6082 Order, User = self.classes.Order, self.classes.User

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected