From: Mike Bayer Date: Fri, 31 May 2013 00:26:45 +0000 (-0400) Subject: add a test for the exception we want to raise here X-Git-Tag: rel_0_9_0b1~304^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cc6494802b1a605f3966449079e7c4467eddce5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add a test for the exception we want to raise here --- diff --git a/test/orm/test_froms.py b/test/orm/test_froms.py index 2bc9383682..1a972d9656 100644 --- a/test/orm/test_froms.py +++ b/test/orm/test_froms.py @@ -438,6 +438,18 @@ class ColumnAccessTest(QueryTest, AssertsCompiledSQL): "users) AS anon_1 WHERE anon_1.name = :name_1" ) + def test_select_entity_from_no_entities(self): + User = self.classes.User + sess = create_session() + + q = sess.query(User) + assert_raises_message( + sa.exc.ArgumentError, + r"A selectable \(FromClause\) instance is " + "expected when the base alias is being set", + sess.query(User).select_entity_from, User + ) + def test_select_from_no_aliasing(self): User = self.classes.User sess = create_session()