From e288aff8eae6d08b040ad9026449ff4578104d1b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 23 Jun 2013 14:03:47 -0400 Subject: The resolution of :class:`.ForeignKey` objects to their target :class:`.Column` has been reworked to be as immediate as possible, based on the moment that the target :class:`.Column` is associated with the same :class:`.MetaData` as this :class:`.ForeignKey`, rather than waiting for the first time a join is constructed, or similar. This along with other improvements allows earlier detection of some foreign key configuration issues. Also included here is a rework of the type-propagation system, so that it should be reliable now to set the type as ``None`` on any :class:`.Column` that refers to another via :class:`.ForeignKey` - the type will be copied from the target column as soon as that other column is associated, and now works for composite foreign keys as well. [ticket:1765] --- test/sql/test_selectable.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/sql/test_selectable.py') diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py index 501cd3776..6a0511faa 100644 --- a/test/sql/test_selectable.py +++ b/test/sql/test_selectable.py @@ -985,14 +985,16 @@ class JoinConditionTest(fixtures.TestBase, AssertsCompiledSQL): t2 = Table('t2', m, Column('id', Integer)) assert_raises_message( exc.NoReferencedColumnError, - "Could not create ForeignKey 't2.q' on table 't1': " + "Could not initialize target column for " + "ForeignKey 't2.q' on table 't1': " "table 't2' has no column named 'q'", sql_util.join_condition, t1, t2 ) assert_raises_message( exc.NoReferencedColumnError, - "Could not create ForeignKey 't2.q' on table 't1': " + "Could not initialize target column for " + "ForeignKey 't2.q' on table 't1': " "table 't2' has no column named 'q'", sql_util.join_condition, t2, t1 ) -- cgit v1.2.1