Update UnitTest methods deprecated in Python 2.7

This commit is contained in:
adustman
2012-09-07 15:32:48 +00:00
parent 3070f46d7d
commit 81dbbc5174
5 changed files with 56 additions and 55 deletions

View File

@ -127,12 +127,12 @@ class DatabaseTest(unittest.TestCase):
self.cursor.execute('select col1 from %s where col1=%s' % \
(self.table, 0))
l = self.cursor.fetchall()
self.failIf(l, "DELETE didn't work")
self.assertFalse(l, "DELETE didn't work")
self.connection.rollback()
self.cursor.execute('select col1 from %s where col1=%s' % \
(self.table, 0))
l = self.cursor.fetchall()
self.failUnless(len(l) == 1, "ROLLBACK didn't work")
self.assertTrue(len(l) == 1, "ROLLBACK didn't work")
self.cursor.execute('drop table %s' % (self.table))
def test_truncation(self):