From: Torsten Werner Date: Fri, 21 Jan 2011 14:09:22 +0000 (+0100) Subject: Simplify DebVersionTestCase. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=934c07e6c1e9257562d0c38e61f3daa6a9af3cc1;p=dak.git Simplify DebVersionTestCase. Signed-off-by: Torsten Werner --- diff --git a/tests/dbtest_debversion.py b/tests/dbtest_debversion.py index ae4baf1b..c45200d1 100755 --- a/tests/dbtest_debversion.py +++ b/tests/dbtest_debversion.py @@ -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()