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

Method test_select_from_alias

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

Source from the content-addressed store, hash-verified

2623 )
2624
2625 def test_select_from_alias(self):
2626 User, Address = self.classes.User, self.classes.Address
2627
2628 sess = fixture_session()
2629 u1 = sess.get(User, 7)
2630 a1 = aliased(Address)
2631 with assertions.expect_deprecated_20(query_wparent_dep):
2632 q = sess.query(a1).with_parent(u1)
2633 self.assert_compile(
2634 q,
2635 "SELECT addresses_1.id AS addresses_1_id, "
2636 "addresses_1.user_id AS addresses_1_user_id, "
2637 "addresses_1.email_address AS addresses_1_email_address "
2638 "FROM addresses AS addresses_1 "
2639 "WHERE :param_1 = addresses_1.user_id",
2640 {"param_1": 7},
2641 )
2642
2643 def test_select_from_alias_explicit_prop(self):
2644 User, Address = self.classes.User, self.classes.Address

Callers

nothing calls this directly

Calls 6

fixture_sessionFunction · 0.90
aliasedFunction · 0.90
with_parentMethod · 0.80
assert_compileMethod · 0.80
getMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected