

@testing.only_on('mysql', 'Multi table update')
def test_defaults_second_table(self):
    (users, addresses) = (self.tables.users, self.tables.addresses)
    values = {
        addresses.c.email_address: users.c.name,
        users.c.name: 'ed2',
    }
    ret = testing.db.execute(addresses.update().values(values).where((users.c.id == addresses.c.user_id)).where((users.c.name == 'ed')))
    eq_(set(ret.prefetch_cols()), set([users.c.some_update]))
    expected = [(2, 8, 'ed'), (3, 8, 'ed'), (4, 9, 'fred@fred.com')]
    self._assert_addresses(addresses, expected)
    expected = [(8, 'ed2', 'im the update'), (9, 'fred', 'value')]
    self._assert_users(users, expected)

dataset/ETHPy150Open zzzeek/sqlalchemy/test/sql/test_update.py UpdateFromMultiTableUpdateDefaultsTest.test_defaults_second_table/original