]> git.decadent.org.uk Git - dak.git/commitdiff
Simplify DebVersionTestCase.
authorTorsten Werner <twerner@debian.org>
Fri, 21 Jan 2011 14:09:22 +0000 (15:09 +0100)
committerTorsten Werner <twerner@debian.org>
Fri, 21 Jan 2011 14:09:22 +0000 (15:09 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
tests/dbtest_debversion.py

index ae4baf1ba6e08ae283fce4f0902681ea934d293b..c45200d1f2440d7a3e96f43d5ad57de561d5f45a 100755 (executable)
@@ -48,13 +48,13 @@ class DebVersionTestCase(DBDakTestCase):
         self.assertEqual(0, q.filter(Version.version > '1.0').count())
         self.assertEqual(2, q.filter(Version.version != '1.0').count())
         self.assertEqual(2, q.filter(Version.version.in_(['0.5~', '1.0'])).count())
-        q = self.session.query(func.min(Version.version).label('min'))
-        self.assertEqual('0.5~', q.one().min)
-        q = self.session.query(func.max(Version.version).label('max'))
-        self.assertEqual('1.0', q.one().max)
+        q = self.session.query(func.min(Version.version))
+        self.assertEqual('0.5~', q.scalar())
+        q = self.session.query(func.max(Version.version))
+        self.assertEqual('1.0', q.scalar())
 
     def tearDown(self):
-        self.session.close()
+        self.session.rollback()
         self.version_table.drop()
         super(DebVersionTestCase, self).tearDown()