]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
(no commit message)
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 18 Oct 2005 05:34:15 +0000 (05:34 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 18 Oct 2005 05:34:15 +0000 (05:34 +0000)
test/attributes.py
test/objectstore.py

index 7b3c82d7b60e14928c7d7af7468ffa3c20db7e07..7e4229f5fa5fe345d960d79270e17410906a2788 100644 (file)
@@ -74,6 +74,8 @@ class AttributesTest(PersistTest):
         print repr(u.__dict__)
         print repr(u.addresses[0].__dict__)
         self.assert_(u.user_id == 7 and u.user_name == 'john' and u.addresses[0].email_address == 'lala@123.com')
+        self.assert_(len(u.addresses.unchanged_items()) == 1)
 
+        
 if __name__ == "__main__":
     unittest.main()
index 8d8ffea21af0982f6e9002f6ecb0face36063eaa..b80318ffe9134ba5d2c62b77501650f3d3c817a9 100644 (file)
@@ -552,8 +552,17 @@ class SaveTest(AssertMixin):
         ])
 
         objects[2].keywords.append(k)
-        self.echo("added: " + repr(objects[2].keywords.added_items()))
-        objectstore.uow().commit()
+        del objects[5].keywords[1]
+        self.assert_sql(db, lambda:objectstore.commit(), [
+                (
+                    "DELETE FROM itemkeywords WHERE itemkeywords.item_id = :item_id AND itemkeywords.keyword_id = :keyword_id",
+                    [{'item_id': 6, 'keyword_id': 6}]
+                ),
+                (   
+                    "INSERT INTO itemkeywords (item_id, keyword_id) VALUES (:item_id, :keyword_id)",
+                    [{'item_id': 3, 'keyword_id': 11}]
+                )
+        ])
         
     def testassociation(self):
         class IKAssociation(object):