diff options
author | Michael Williamson <mike@zwobble.org> | 2016-08-28 12:38:04 +0100 |
---|---|---|
committer | Michael Williamson <mike@zwobble.org> | 2016-08-28 12:38:04 +0100 |
commit | 94fe6fe05dacf6f38dd0541fd59b0ca76b440c4e (patch) | |
tree | db5c13fd44a729a2352c4ae69ac1f3c8a5abc94a /test/orm/test_joins.py | |
parent | 117997cd5b849a236208cf9ea16f0f09c6962804 (diff) | |
download | sqlalchemy-pr/304.tar.gz |
Provide more informative error when joining with no entitiespr/304
Diffstat (limited to 'test/orm/test_joins.py')
-rw-r--r-- | test/orm/test_joins.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/orm/test_joins.py b/test/orm/test_joins.py index e14af635d..01f8627bc 100644 --- a/test/orm/test_joins.py +++ b/test/orm/test_joins.py @@ -447,6 +447,19 @@ class JoinTest(QueryTest, AssertsCompiledSQL): sess.query(literal_column('x'), User).join, Address ) + def test_left_is_none_and_query_has_no_entities(self): + User = self.classes.User + Address = self.classes.Address + + sess = create_session() + + assert_raises_message( + sa_exc.InvalidRequestError, + "No entities to join from; please use select_from\(\) to " + "establish the left entity/selectable of this join", + sess.query().join, Address + ) + def test_isouter_flag(self): User = self.classes.User |