From 752ef2802c57d32fe832b76b9503f42f0300da05 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 3 May 2007 22:31:52 +0000 Subject: - _Label class overrides compare_self to return its ultimate object. meaning, if you say someexpr.label('foo') == 5, it produces the correct "someexpr == 5". --- test/sql/select.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/sql') diff --git a/test/sql/select.py b/test/sql/select.py index c10f12c2c..ccd5c33a8 100644 --- a/test/sql/select.py +++ b/test/sql/select.py @@ -218,7 +218,11 @@ sq.myothertable_othername AS sq_myothertable_othername FROM (" + sqstring + ") A order_by = ['dist', places.c.nm] ) self.runtest(q, "SELECT places.id, places.nm, main_zip.zipcode, latlondist((SELECT zips.latitude FROM zips WHERE zips.zipcode = main_zip.zipcode), (SELECT zips.longitude FROM zips WHERE zips.zipcode = main_zip.zipcode)) AS dist FROM places, zips AS main_zip ORDER BY dist, places.nm") - + + def testlabelcomparison(self): + x = func.lala(table1.c.myid).label('foo') + self.runtest(select([x], x==5), "SELECT lala(mytable.myid) AS foo FROM mytable WHERE lala(mytable.myid) = :literal") + def testand(self): self.runtest( select(['*'], and_(table1.c.myid == 12, table1.c.name=='asdf', table2.c.othername == 'foo', "sysdate() = today()")), -- cgit v1.2.1