def test_float(self): self.assertRaises(TypeError, Float, 'sql injection') try: Float(True) except TypeError: self.fail("Float() raised TypeError on bool.")
def test_float(self): f = 3.2 db_value = float(Float(f).as_sql()) self.assertEqual(Float.to_python(db_value), f)