diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-02-04 03:43:22 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-02-04 03:43:22 +0000 |
| commit | 80f48f250b49f87a67c83ea71b0635d6645f26c3 (patch) | |
| tree | 5544bf7288a556b847d7dd296f7918a57cf93ce0 /test/sql/quote.py | |
| parent | 8908ea81d230185ddda53509594757929e65e3a5 (diff) | |
| download | sqlalchemy-80f48f250b49f87a67c83ea71b0635d6645f26c3.tar.gz | |
- added literal_column() to specify a column clause that should not undergo any quoting
- straight text sent to select() added as literal_column
- fix for issue in [ticket:450]
Diffstat (limited to 'test/sql/quote.py')
| -rw-r--r-- | test/sql/quote.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/sql/quote.py b/test/sql/quote.py index 403ae2d42..bd8b206d6 100644 --- a/test/sql/quote.py +++ b/test/sql/quote.py @@ -98,12 +98,11 @@ class QuoteTest(PersistTest): assert str(select([x.c.ImATable_col1])) == '''SELECT "SomeAlias"."ImATable_col1" \nFROM (SELECT "ImATable".col1 AS "ImATable_col1" \nFROM "ImATable") AS "SomeAlias"''' # note that 'foo' and 'FooCol' are literals already quoted - x = select([sql.column("'foo'").label("somelabel")], from_obj=[table]).alias("AnAlias") + x = select([sql.literal_column("'foo'").label("somelabel")], from_obj=[table]).alias("AnAlias") x = x.select() - #print x assert str(x) == '''SELECT "AnAlias".somelabel \nFROM (SELECT 'foo' AS somelabel \nFROM "ImATable") AS "AnAlias"''' - x = select([sql.column("'FooCol'").label("SomeLabel")], from_obj=[table]) + x = select([sql.literal_column("'FooCol'").label("SomeLabel")], from_obj=[table]) x = x.select() assert str(x) == '''SELECT "SomeLabel" \nFROM (SELECT 'FooCol' AS "SomeLabel" \nFROM "ImATable")''' |
