MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_exec_two_table

Method test_exec_two_table

test/sql/test_update.py:1646–1663  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

1644
1645 @testing.requires.update_from
1646 def test_exec_two_table(self, connection):
1647 users, addresses = self.tables.users, self.tables.addresses
1648
1649 connection.execute(
1650 addresses.update()
1651 .values(email_address=users.c.name)
1652 .where(users.c.id == addresses.c.user_id)
1653 .where(users.c.name == "ed")
1654 )
1655
1656 expected = [
1657 (1, 7, "x", "jack@bean.com"),
1658 (2, 8, "x", "ed"),
1659 (3, 8, "x", "ed"),
1660 (4, 8, "x", "ed"),
1661 (5, 9, "x", "fred@fred.com"),
1662 ]
1663 self._assert_addresses(connection, addresses, expected)
1664
1665 @testing.requires.update_from
1666 def test_exec_two_table_plus_alias(self, connection):

Callers

nothing calls this directly

Calls 5

_assert_addressesMethod · 0.95
executeMethod · 0.45
whereMethod · 0.45
valuesMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected