예제 #1
0
 def test_get_decimal_variable_to_str_column(self):
     variable = DecimalVariable()
     variable.set("40.5", from_db=True)
     self.connection.execute("INSERT INTO test VALUES (40, ?)",
                             (variable, ))
     result = self.connection.execute("SELECT title FROM test WHERE id=40")
     self.assertEquals(result.get_one()[0], "40.5")
예제 #2
0
def compile_decimal(compile, expr, state):
    state.parameters.append(DecimalVariable(expr))
    return "?"
예제 #3
0
 def test_set_decimal_variable_from_str_column(self):
     self.connection.execute("INSERT INTO test VALUES (40, '40.5')")
     variable = DecimalVariable()
     result = self.connection.execute("SELECT title FROM test WHERE id=40")
     result.set_variable(variable, result.get_one()[0])