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

Method test_named_subquery

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

Source from the content-addressed store, hash-verified

2167 )
2168
2169 def test_named_subquery(self):
2170 User = self.classes.User
2171
2172 session = fixture_session()
2173 a1 = session.query(User.id).filter(User.id == 7).subquery("foo1")
2174 a2 = session.query(User.id).filter(User.id == 7).subquery(name="foo2")
2175 a3 = session.query(User.id).filter(User.id == 7).subquery()
2176
2177 eq_(a1.name, "foo1")
2178 eq_(a2.name, "foo2")
2179 eq_regex(a3.name, r"%\([0-9a-z]+ anon\)s")
2180
2181 def test_labeled_subquery(self):
2182 User = self.classes.User

Callers

nothing calls this directly

Calls 6

fixture_sessionFunction · 0.90
eq_Function · 0.90
eq_regexFunction · 0.90
subqueryMethod · 0.45
filterMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected