]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added test coverage for r3512
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 24 Sep 2007 13:51:44 +0000 (13:51 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 24 Sep 2007 13:51:44 +0000 (13:51 +0000)
test/orm/mapper.py

index 6c31420612a3b9b0625e030f8b1f9941922d1508..d02feac47ec4ab2bf4488c6ceb57c940a0caa9b0 100644 (file)
@@ -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"""