diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-05 23:47:49 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-05 23:47:49 -0400 |
| commit | d79e1d69a6b2d0d1cc18d3d9d0283ef4a77925bc (patch) | |
| tree | 0920ce1c66894cdf5a2ba60c1f53e79fddb90a75 /test/sql | |
| parent | aba78471867d1ae2cfbbf358482b2a9b771cc6b0 (diff) | |
| download | sqlalchemy-d79e1d69a6b2d0d1cc18d3d9d0283ef4a77925bc.tar.gz | |
- fix propagation of quote flag within _gen_label() so that if the
name is already an instance of _anonymous_label(), we don't downgrade
it to a plain quoted_name - fixes regression from [ticket:2812].
[ticket:2834]
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_quote.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py index db1e0b8a5..3cab3dc79 100644 --- a/test/sql/test_quote.py +++ b/test/sql/test_quote.py @@ -612,7 +612,20 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL): 'CREATE INDEX foo ON t ("x")' ) + def test_quote_flag_propagate_anon_label(self): + m = MetaData() + t = Table('t', m, Column('x', Integer, quote=True)) + self.assert_compile( + select([t.alias()]).apply_labels(), + 'SELECT t_1."x" AS "t_1_x" FROM t AS t_1' + ) + + t2 = Table('t2', m, Column('x', Integer), quote=True) + self.assert_compile( + select([t2.c.x]).apply_labels(), + 'SELECT "t2".x AS "t2_x" FROM "t2"' + ) class PreparerTest(fixtures.TestBase): """Test the db-agnostic quoting services of IdentifierPreparer.""" |
