]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Don't re-save objects in these tests (post r3681)
authorJason Kirtland <jek@discorporate.us>
Wed, 31 Oct 2007 03:17:51 +0000 (03:17 +0000)
committerJason Kirtland <jek@discorporate.us>
Wed, 31 Oct 2007 03:17:51 +0000 (03:17 +0000)
test/ext/associationproxy.py

index f602871c2c3ca5d52f1329155c0619d6fe1ec79e..71c029e071b15bb8f647eeffb49aa309d0597f9d 100644 (file)
@@ -79,7 +79,8 @@ class _CollectionOperations(PersistTest):
         self.metadata.drop_all()
 
     def roundtrip(self, obj):
-        self.session.save(obj)
+        if obj not in self.session:
+            self.session.save(obj)
         self.session.flush()
         id, type_ = obj.id, type(obj)
         self.session.clear()
@@ -185,6 +186,7 @@ class _CollectionOperations(PersistTest):
         after = ['a', 'b', 'O', 'z', 'O', 'z', 'O', 'h', 'O', 'j']
         self.assert_(p1.children == after)
         self.assert_([c.name for c in p1._children] == after)
+
         
 class DefaultTest(_CollectionOperations):
     def __init__(self, *args, **kw):
@@ -545,7 +547,8 @@ class ScalarTest(PersistTest):
         session = create_session()
 
         def roundtrip(obj):
-            session.save(obj)
+            if obj not in session:
+                session.save(obj)
             session.flush()
             id, type_ = obj.id, type(obj)
             session.clear()