From: Jason Kirtland Date: Wed, 31 Oct 2007 03:17:51 +0000 (+0000) Subject: - Don't re-save objects in these tests (post r3681) X-Git-Tag: rel_0_4_1~95 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=259b256759e2c1d59d2b80d3702215145b7f032f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Don't re-save objects in these tests (post r3681) --- diff --git a/test/ext/associationproxy.py b/test/ext/associationproxy.py index f602871c2c..71c029e071 100644 --- a/test/ext/associationproxy.py +++ b/test/ext/associationproxy.py @@ -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()