diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-08-01 13:27:43 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-08-01 16:26:02 -0400 |
| commit | f17b4976d862a8f23efce91107274ffc115f5a2d (patch) | |
| tree | b748b43d46c33966eef87a1892e3fdf01b173810 /test/sql | |
| parent | 896d47f318c5c27620fd6da805f98811941b88c5 (diff) | |
| download | sqlalchemy-f17b4976d862a8f23efce91107274ffc115f5a2d.tar.gz | |
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
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_generative.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/sql/test_generative.py b/test/sql/test_generative.py index 93e435517..8f06cf3db 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): |
