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

Method test_noparent

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

Source from the content-addressed store, hash-verified

6553 )
6554
6555 def test_noparent(self):
6556 Item, User = self.classes.Item, self.classes.User
6557
6558 sess = fixture_session()
6559 q = sess.query(User)
6560
6561 u1 = q.filter_by(name="jack").one()
6562
6563 # TODO: this can perhaps raise an error, then again it's doing what's
6564 # asked...
6565 q = sess.query(Item).filter(with_parent(u1, User.orders))
6566 self.assert_compile(
6567 q,
6568 "SELECT items.id AS items_id, "
6569 "items.description AS items_description "
6570 "FROM items, orders WHERE :param_1 = orders.user_id",
6571 )
6572
6573 def test_m2m(self):
6574 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