]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- merged the unit test for the column_prefix fix that was established in the 0.3
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 7 Sep 2007 19:57:01 +0000 (19:57 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 7 Sep 2007 19:57:01 +0000 (19:57 +0000)
trunk in r2795.  the actual "fix" part of it I just happened to spot manually
the other day and fixed without testing (forgot what the original failure condition was) in r3449.

test/orm/mapper.py

index f00c1c59d0b12f3db4b9c9678aed0a31dda6d3d2..ce5db508a7efcb3ae5f09d107b793e80bbc35d92 100644 (file)
@@ -47,13 +47,18 @@ class MapperTest(MapperSuperTest):
             assert str(e) == "Invalid cascade option 'fake'"
         
     def testcolumnprefix(self):
-        mapper(User, users, column_prefix='_')
+        mapper(User, users, column_prefix='_', properties={ 
+            'user_name':synonym('_user_name') 
+        })
+
         s = create_session()
         u = s.get(User, 7)
         assert u._user_name=='jack'
        assert u._user_id ==7
         assert not hasattr(u, 'user_name')
-          
+        u2 = s.query(User).filter_by(user_name='jack').one() 
+        assert u is u2
+        
     def testrefresh(self):
         mapper(User, users, properties={'addresses':relation(mapper(Address, addresses), backref='user')})
         s = create_session()