summaryrefslogtreecommitdiff
path: root/test/testlib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-04-01 17:13:09 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-04-01 17:13:09 +0000
commitad231da3b83bcdad4446690fa37fbe03408a40d6 (patch)
treeaf2efdd02ba000e2b994b7e191f964bed336a841 /test/testlib
parent1e0a91fe81cd8cf38603c7147ebf2e79301be6f5 (diff)
downloadsqlalchemy-ad231da3b83bcdad4446690fa37fbe03408a40d6.tar.gz
- merge() may actually work now, though we've heard that before...
- merge() uses the priamry key attributes on the object if _instance_key not present. so merging works for instances that dont have an instnace_key, will still issue UPDATE for existing rows. - improved collection behavior for merge() - will remove elements from a destination collection that are not in the source. - fixed naive set-mutation issue in Select._get_display_froms - simplified fixtures.Base a bit
Diffstat (limited to 'test/testlib')
-rw-r--r--test/testlib/fixtures.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/test/testlib/fixtures.py b/test/testlib/fixtures.py
index bbd27a39f..a1aa717e9 100644
--- a/test/testlib/fixtures.py
+++ b/test/testlib/fixtures.py
@@ -54,19 +54,11 @@ class Base(object):
except AttributeError:
#print "b class does not have attribute named '%s'" % attr
return False
- #print "other:", battr
- if not hasattr(value, '__len__'):
- value = list(iter(value))
- battr = list(iter(battr))
- if len(value) != len(battr):
- #print "Length of collection '%s' does not match that of b" % attr
- return False
- for (us, them) in zip(value, battr):
- if us != them:
- #print "1. Attribute named '%s' does not match b" % attr
- return False
- else:
+
+ if list(value) == list(battr):
continue
+ else:
+ return False
else:
if value is not None:
if value != getattr(b, attr, None):