summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/orm/fixtures.py12
-rw-r--r--test/orm/unitofwork.py2
-rw-r--r--test/sql/quote.py2
-rw-r--r--test/testlib/testing.py2
4 files changed, 10 insertions, 8 deletions
diff --git a/test/orm/fixtures.py b/test/orm/fixtures.py
index 33e0a419b..ed06c4d30 100644
--- a/test/orm/fixtures.py
+++ b/test/orm/fixtures.py
@@ -8,11 +8,13 @@ class Base(object):
for k in kwargs:
setattr(self, k, kwargs[k])
- def __repr__(self):
- return "%s(%s)" % (
- (self.__class__.__name__),
- ','.join(["%s=%s" % (key, repr(getattr(self, key))) for key in self.__dict__ if not key.startswith('_')])
- )
+ # TODO: add recursion checks to this
+ #def __repr__(self):
+ # return "%s(%s)" % (
+ # (self.__class__.__name__),
+ # ','.join(["%s=%s" % (key, repr(getattr(self, key))) for key in self.__dict__ if not key.startswith('_')])
+ # )
+
def __ne__(self, other):
return not self.__eq__(other)
diff --git a/test/orm/unitofwork.py b/test/orm/unitofwork.py
index 41400a333..df678cf09 100644
--- a/test/orm/unitofwork.py
+++ b/test/orm/unitofwork.py
@@ -809,7 +809,7 @@ class OneToManyTest(ORMTest):
Session.commit()
Session.delete(u)
Session.commit()
- self.assert_(a.address_id is not None and a.user_id is None and not Session.identity_map.has_key(u._instance_key) and Session.identity_map.has_key(a._instance_key))
+ self.assert_(a.address_id is not None and a.user_id is None and u._instance_key not in Session.identity_map and a._instance_key in Session.identity_map)
def test_onetoone(self):
m = mapper(User, users, properties = dict(
diff --git a/test/sql/quote.py b/test/sql/quote.py
index f36b89210..ad25619df 100644
--- a/test/sql/quote.py
+++ b/test/sql/quote.py
@@ -49,7 +49,7 @@ class QuoteTest(PersistTest):
def testreflect(self):
meta2 = MetaData(testbase.db)
t2 = Table('WorstCase2', meta2, autoload=True, quote=True)
- assert t2.c.has_key('MixedCase')
+ assert 'MixedCase' in t2.c
def testlabels(self):
table1.insert().execute({'lowercase':1,'UPPERCASE':2,'MixedCase':3,'a123':4},
diff --git a/test/testlib/testing.py b/test/testlib/testing.py
index 9afb21587..88bc99792 100644
--- a/test/testlib/testing.py
+++ b/test/testlib/testing.py
@@ -140,7 +140,7 @@ class ExecutionContextWrapper(object):
# asserting a dictionary of statements->parameters
# this is to specify query assertions where the queries can be in
# multiple orderings
- if not item.has_key('_converted'):
+ if '_converted' not in item:
for key in item.keys():
ckey = self.convert_statement(key)
item[ckey] = item[key]