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

Method test_with_transient

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

Source from the content-addressed store, hash-verified

1875 ] == k
1876
1877 def test_with_transient(self):
1878 User, Order = self.classes.User, self.classes.Order
1879
1880 sess = fixture_session()
1881
1882 q = sess.query(User)
1883 u1 = q.filter_by(name="jack").one()
1884 utrans = User(id=u1.id)
1885 with assertions.expect_deprecated_20(query_wparent_dep):
1886 o = sess.query(Order).with_parent(utrans, User.orders)
1887 eq_(
1888 [
1889 Order(description="order 1"),
1890 Order(description="order 3"),
1891 Order(description="order 5"),
1892 ],
1893 o.all(),
1894 )
1895
1896 def test_with_pending_autoflush(self):
1897 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