diff options
Diffstat (limited to 'test/sql/select.py')
-rw-r--r-- | test/sql/select.py | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/test/sql/select.py b/test/sql/select.py index b4e47c3e0..dd082fb8d 100644 --- a/test/sql/select.py +++ b/test/sql/select.py @@ -327,53 +327,7 @@ sq.myothertable_othername AS sq_myothertable_othername FROM (" + sqstring + ") A x = func.lala(table1.c.myid).label('foo') self.assert_compile(select([x], x==5), "SELECT lala(mytable.myid) AS foo FROM mytable WHERE lala(mytable.myid) = :param_1") - def test_labels_in_expressions(self): - """test that label() constructs in ORDER BY render as the labelname. - - Postgres' behavior was used as the guide for this, - so that only a simple label expression - and not a more complex expression involving the label - name would be rendered using the label name. - - """ - lab1 = (table1.c.myid + "12").label('foo') - lab2 = func.somefunc(table1.c.name).label('bar') - - dialect = default.DefaultDialect() - self.assert_compile(select([lab1, lab2]).order_by(lab1, desc(lab2)), - "SELECT mytable.myid + :myid_1 AS foo, somefunc(mytable.name) AS bar FROM mytable ORDER BY foo, bar DESC", - dialect=dialect - ) - - # the function embedded label renders as the function - self.assert_compile(select([lab1, lab2]).order_by(func.hoho(lab1), desc(lab2)), - "SELECT mytable.myid + :myid_1 AS foo, somefunc(mytable.name) AS bar FROM mytable ORDER BY hoho(mytable.myid + :myid_1), bar DESC", - dialect=dialect - ) - - # binary expressions render as the expression without labels - self.assert_compile(select([lab1, lab2]).order_by(lab1 + "test"), - "SELECT mytable.myid + :myid_1 AS foo, somefunc(mytable.name) AS bar FROM mytable ORDER BY mytable.myid + :myid_1 + :param_1", - dialect=dialect - ) - - # labels within functions in the columns clause render with the expression - self.assert_compile( - select([lab1, func.foo(lab1)]), - "SELECT mytable.myid + :myid_1 AS foo, foo(mytable.myid + :myid_1) AS foo_1 FROM mytable", - dialect=dialect - ) - - dialect = default.DefaultDialect() - dialect.supports_simple_order_by_label = False - self.assert_compile(select([lab1, lab2]).order_by(lab1, desc(lab2)), - "SELECT mytable.myid + :myid_1 AS foo, somefunc(mytable.name) AS bar FROM mytable ORDER BY mytable.myid + :myid_1, somefunc(mytable.name) DESC", - dialect=dialect - ) - self.assert_compile(select([lab1, lab2]).order_by(func.hoho(lab1), desc(lab2)), - "SELECT mytable.myid + :myid_1 AS foo, somefunc(mytable.name) AS bar FROM mytable ORDER BY hoho(mytable.myid + :myid_1), somefunc(mytable.name) DESC", - dialect=dialect - ) + def test_conjunctions(self): self.assert_compile( |