From 4ed4266803cbba480e5785103302eba5b5a86652 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 2 Feb 2014 14:40:23 -0500 Subject: [PATCH] - use from_statement() for the ORM column test - with select_from(), add external order by so that Oracle orders correctly --- test/orm/test_query.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/orm/test_query.py b/test/orm/test_query.py index 07cb24cb62..dbac48580b 100644 --- a/test/orm/test_query.py +++ b/test/orm/test_query.py @@ -2092,31 +2092,30 @@ class TextTest(QueryTest): [User(id=7), User(id=8), User(id=9), User(id=10)] ) - def test_via_textasfrom_select_from(self): + def test_via_textasfrom_use_mapped_columns(self): User = self.classes.User s = create_session() eq_( - s.query(User).select_from( + s.query(User).from_statement( text("select * from users order by id").\ - columns(id=Integer, name=String) + columns(User.id, User.name) ).all(), [User(id=7), User(id=8), User(id=9), User(id=10)] ) - def test_via_textasfrom_use_mapped_columns(self): + def test_via_textasfrom_select_from(self): User = self.classes.User s = create_session() eq_( s.query(User).select_from( - text("select * from users order by id").\ - columns(User.id, User.name) - ).all(), + text("select * from users").\ + columns(id=Integer, name=String) + ).order_by(User.id).all(), [User(id=7), User(id=8), User(id=9), User(id=10)] ) - class ParentTest(QueryTest, AssertsCompiledSQL): __dialect__ = 'default' -- 2.47.3