From: Mike Bayer Date: Wed, 24 Mar 2010 20:18:01 +0000 (-0400) Subject: add a test I'm surprised we didn't have X-Git-Tag: rel_0_6beta3~12^2~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2db0f5f794a63e8f9fa6dc1e7b38f7375b6a6346;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add a test I'm surprised we didn't have --- diff --git a/test/orm/test_query.py b/test/orm/test_query.py index 4e2cdec7fb..5b8860f523 100644 --- a/test/orm/test_query.py +++ b/test/orm/test_query.py @@ -690,6 +690,11 @@ class FilterTest(QueryTest): assert [] == create_session().query(User).order_by(User.id)[3:3] assert [] == create_session().query(User).order_by(User.id)[0:0] + def test_exists(self): + sess = create_session() + + assert sess.query(exists([User.id])).filter(User.id==9).scalar() + assert not sess.query(exists([User.id])).filter(User.id==29).scalar() def test_one_filter(self): assert [User(id=8), User(id=9)] == create_session().query(User).filter(User.name.endswith('ed')).all()