From 8c9795d9e4b39eba655bdf656b2645224f7c8b13 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 24 Sep 2007 13:51:44 +0000 Subject: [PATCH] added test coverage for r3512 --- test/orm/mapper.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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""" -- 2.47.3