MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_select_from_alias

Method test_select_from_alias

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

Source from the content-addressed store, hash-verified

1764 )
1765
1766 def test_select_from_alias(self):
1767 User, Address = self.classes.User, self.classes.Address
1768
1769 sess = fixture_session()
1770 u1 = sess.get(User, 7)
1771 a1 = aliased(Address)
1772 with assertions.expect_deprecated_20(query_wparent_dep):
1773 q = sess.query(a1).with_parent(u1)
1774 self.assert_compile(
1775 q,
1776 "SELECT addresses_1.id AS addresses_1_id, "
1777 "addresses_1.user_id AS addresses_1_user_id, "
1778 "addresses_1.email_address AS addresses_1_email_address "
1779 "FROM addresses AS addresses_1 "
1780 "WHERE :param_1 = addresses_1.user_id",
1781 {"param_1": 7},
1782 )
1783
1784 def test_select_from_alias_explicit_prop(self):
1785 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