Added regression test on bool adaptation.

This commit is contained in:
Daniele Varrazzo 2010-12-24 15:54:01 +01:00
parent beba064983
commit 60841c6567

View File

@ -68,6 +68,12 @@ class TypesBasicTests(unittest.TestCase):
self.failUnless(abs(s - 19.10) < 0.001, self.failUnless(abs(s - 19.10) < 0.001,
"wrong float quoting: " + str(s)) "wrong float quoting: " + str(s))
def testBoolean(self):
x = self.execute("SELECT %s as foo", (False,))
self.assert_(x is False)
x = self.execute("SELECT %s as foo", (True,))
self.assert_(x is True)
def testDecimal(self): def testDecimal(self):
if sys.version_info[0:2] >= (2, 4): if sys.version_info[0:2] >= (2, 4):
s = self.execute("SELECT %s AS foo", (decimal.Decimal("19.10"),)) s = self.execute("SELECT %s AS foo", (decimal.Decimal("19.10"),))