MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_autocorrelate_error

Method test_autocorrelate_error

test/sql/test_update.py:1620–1639  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1618 )
1619
1620 def test_autocorrelate_error(self):
1621 users, addresses = self.tables.users, self.tables.addresses
1622
1623 stmt = (
1624 users.update()
1625 .values(name="newname")
1626 .where(users.c.id == addresses.c.user_id)
1627 .where(
1628 ~exists()
1629 .where(addresses.c.user_id == users.c.id)
1630 .where(addresses.c.email_address == "foo")
1631 )
1632 )
1633
1634 assert_raises_message(
1635 exc.InvalidRequestError,
1636 ".*returned no FROM clauses due to auto-correlation.*",
1637 stmt.compile,
1638 dialect=default.StrCompileDialect(),
1639 )
1640
1641
1642class UpdateFromRoundTripTest(_UpdateFromTestBase, fixtures.TablesTest):

Callers

nothing calls this directly

Calls 5

existsFunction · 0.90
assert_raises_messageFunction · 0.90
whereMethod · 0.45
valuesMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected