MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_noparent

Method test_noparent

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

Source from the content-addressed store, hash-verified

6028 )
6029
6030 def test_noparent(self):
6031 Item, User = self.classes.Item, self.classes.User
6032
6033 sess = fixture_session()
6034 q = sess.query(User)
6035
6036 u1 = q.filter_by(name="jack").one()
6037
6038 # TODO: this can perhaps raise an error, then again it's doing what's
6039 # asked...
6040 q = sess.query(Item).filter(with_parent(u1, User.orders))
6041 self.assert_compile(
6042 q,
6043 "SELECT items.id AS items_id, "
6044 "items.description AS items_description "
6045 "FROM items, orders WHERE :param_1 = orders.user_id",
6046 )
6047
6048 def test_m2m(self):
6049 Item, Keyword = self.classes.Item, self.classes.Keyword

Callers

nothing calls this directly

Calls 7

fixture_sessionFunction · 0.90
with_parentFunction · 0.90
assert_compileMethod · 0.80
queryMethod · 0.45
oneMethod · 0.45
filter_byMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected