summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-02-04 03:12:27 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-02-04 03:12:27 +0000
commita8cdead32632045c29260b9bd7c2bcd5f2c8f221 (patch)
treef8e8d83d18b1eaa97afa3008d1339623692f93a7 /test
parent5ce214c7d43a0a0f57785a512272ec2102139fa2 (diff)
downloadsqlalchemy-a8cdead32632045c29260b9bd7c2bcd5f2c8f221.tar.gz
- more quoting fixes for [ticket:450]...quoting more aggressive (but still skips already-quoted literals)
- got mysql to have "format" as default paramstyle even if mysql module not available, allows unit tests to pass in non-mysql system for [ticket:457]. all the dialects should be changed to pass in their usual paramstyle.
Diffstat (limited to 'test')
-rw-r--r--test/sql/defaults.py1
-rw-r--r--test/sql/quote.py6
2 files changed, 7 insertions, 0 deletions
diff --git a/test/sql/defaults.py b/test/sql/defaults.py
index 9d426ab0d..d018c5efb 100644
--- a/test/sql/defaults.py
+++ b/test/sql/defaults.py
@@ -176,6 +176,7 @@ class SequenceTest(PersistTest):
metadata.create_all()
+ @testbase.supported('postgres', 'oracle')
def testseqnonpk(self):
"""test sequences fire off as defaults on non-pk columns"""
sometable.insert().execute(name="somename")
diff --git a/test/sql/quote.py b/test/sql/quote.py
index 607a595d3..403ae2d42 100644
--- a/test/sql/quote.py
+++ b/test/sql/quote.py
@@ -97,10 +97,16 @@ class QuoteTest(PersistTest):
x = select([table.c.col1.label("ImATable_col1")]).alias("SomeAlias")
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 = 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 = x.select()
+ assert str(x) == '''SELECT "SomeLabel" \nFROM (SELECT 'FooCol' AS "SomeLabel" \nFROM "ImATable")'''
+
def testlabelsnocase(self):
metadata = MetaData()
table1 = Table('SomeCase1', metadata,