From: Mike Bayer Date: Mon, 24 Sep 2007 13:51:44 +0000 (+0000) Subject: added test coverage for r3512 X-Git-Tag: rel_0_4beta6~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c9795d9e4b39eba655bdf656b2645224f7c8b13;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git added test coverage for r3512 --- diff --git a/test/orm/mapper.py b/test/orm/mapper.py index 6c31420612..d02feac47e 100644 --- a/test/orm/mapper.py +++ b/test/orm/mapper.py @@ -119,6 +119,15 @@ class MapperTest(MapperSuperTest): assert len(u.addresses) == 3 s.expire(u) assert len(u.addresses) == 3 + + def testincompletecolumns(self): + """test loading from a select which does not contain all columns""" + mapper(Address, addresses) + s = create_session() + a = s.query(Address).from_statement(select([addresses.c.address_id, addresses.c.user_id])).first() + assert a.user_id == 7 + assert a.address_id == 1 + assert a.email_address is None def testbadconstructor(self): """test that if the construction of a mapped class fails, the instnace does not get placed in the session"""