From: Mike Bayer Date: Thu, 1 Aug 2019 17:27:43 +0000 (-0400) Subject: Add additional tests to verify _is_clone_of proxy level link X-Git-Tag: rel_1_4_0b1~777^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f17b4976d862a8f23efce91107274ffc115f5a2d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Add additional tests to verify _is_clone_of proxy level link The commit message in 896d47f318c5c27620fd6da is not accurate, we do in fact still need _is_clone_of when a clone of a column is created so that we can implement _cloned_set(). Additionally, the linkage of _is_clone_of within make_proxy() also suits an additional use case that seems to be related to [ticket:2419]. Adjust one of the tests which likely got changed within 1.4's refactoring of Select to test this correctly. Change-Id: I124c7c6b02498e2dfad9797816df42a5b6f91901 --- diff --git a/test/sql/test_generative.py b/test/sql/test_generative.py index 93e4355174..8f06cf3db1 100644 --- a/test/sql/test_generative.py +++ b/test/sql/test_generative.py @@ -425,12 +425,13 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): eq_(str(f1), str(f2)) def test_aliased_cloned_schema_column_adapt_exported(self): - clause = select([t3.c.col1, func.foo(t3.c.col2).label("foo")]) - c_sub = clause.subquery() + clause = select( + [t3.c.col1, func.foo(t3.c.col2).label("foo")] + ).subquery() - aliased1 = select([c_sub.c.col1, c_sub.c.foo]).subquery() + aliased1 = select([clause.c.col1, clause.c.foo]).subquery() aliased2 = clause - aliased2.selected_columns.col1, aliased2.selected_columns.foo + aliased2.c.col1, aliased2.c.foo aliased3 = cloned_traverse(aliased2, {}, {}) # also fixed by [ticket:2419]. When we look at the @@ -438,8 +439,8 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): # have an _is_clone_of pointer. But we now modified _make_proxy # to assign this. adapter = sql_util.ColumnAdapter(aliased1) - f1 = select([adapter.columns[c] for c in aliased2.selected_columns]) - f2 = select([adapter.columns[c] for c in aliased3.selected_columns]) + f1 = select([adapter.columns[c] for c in aliased2.c]) + f2 = select([adapter.columns[c] for c in aliased3.c]) eq_(str(f1), str(f2)) def test_labeled_expression_adapt(self):