summaryrefslogtreecommitdiff
path: root/test/sql/labels.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-04-29 21:33:05 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-04-29 21:33:05 +0000
commit8d5a0729abff9fe4ac86f49d810564037a68b0e3 (patch)
tree5107f342b6bd5221e5e8c487fc672d009db0c998 /test/sql/labels.py
parent05f1e509518f62d2cdf8cc697e5bf6d4108df432 (diff)
downloadsqlalchemy-8d5a0729abff9fe4ac86f49d810564037a68b0e3.tar.gz
- the label() method on ColumnElement will properly propigate the
TypeEngine of the base element out to the label, including a label() created from a scalar=True select() statement.
Diffstat (limited to 'test/sql/labels.py')
-rw-r--r--test/sql/labels.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/sql/labels.py b/test/sql/labels.py
index 53022a6a0..d69a67ef4 100644
--- a/test/sql/labels.py
+++ b/test/sql/labels.py
@@ -5,6 +5,15 @@ from sqlalchemy import *
# TODO: either create a mock dialect with named paramstyle and a short identifier length,
# or find a way to just use sqlite dialect and make those changes
+class LabelTypeTest(testbase.PersistTest):
+ def test_type(self):
+ m = MetaData()
+ t = Table('sometable', m,
+ Column('col1', Integer),
+ Column('col2', Float))
+ assert isinstance(t.c.col1.label('hi').type, Integer)
+ assert isinstance(select([t.c.col2], scalar=True).label('lala').type, Float)
+
class LongLabelsTest(testbase.PersistTest):
def setUpAll(self):
global metadata, table1