def test_date(self): value = date(1977, 4, 5) self.connection.execute("INSERT INTO datetime_test (d) VALUES (?)", (value,)) result = self.connection.execute("SELECT d FROM datetime_test") variable = DateVariable() result.set_variable(variable, result.get_one()[0]) self.assertEquals(variable.get(), value)
def test_date(self): value = date(1977, 4, 5) self.connection.execute("INSERT INTO datetime_test (d) VALUES (?)", (value, )) result = self.connection.execute("SELECT d FROM datetime_test") variable = DateVariable() result.set_variable(variable, result.get_one()[0]) self.assertEquals(variable.get(), value)
def compile_date(compile, expr, state): state.parameters.append(DateVariable(expr)) return "?"