MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_select_from

Method test_select_from

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

Source from the content-addressed store, hash-verified

5927 with_parent(u1, User.name)
5928
5929 def test_select_from(self):
5930 User, Address = self.classes.User, self.classes.Address
5931
5932 sess = fixture_session()
5933 u1 = sess.get(User, 7)
5934 q = (
5935 sess.query(Address)
5936 .select_from(Address)
5937 .filter(with_parent(u1, User.addresses))
5938 )
5939 self.assert_compile(
5940 q,
5941 "SELECT addresses.id AS addresses_id, "
5942 "addresses.user_id AS addresses_user_id, "
5943 "addresses.email_address AS addresses_email_address "
5944 "FROM addresses WHERE :param_1 = addresses.user_id",
5945 {"param_1": 7},
5946 )
5947
5948 def test_from_entity_standalone_fn(self):
5949 User, Address = self.classes.User, self.classes.Address

Callers

nothing calls this directly

Calls 7

fixture_sessionFunction · 0.90
with_parentFunction · 0.90
assert_compileMethod · 0.80
getMethod · 0.45
filterMethod · 0.45
select_fromMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected