def test_escaped_values(self): column = Column('id', str) value = "test 'escaped' string" assert column.escape(value) == "'test ''escaped'' string'" value = 'test "double quotes"' assert column.escape(value) == "'{}'".format(value)
def test_bytes(self): column = Column('id', str) value = b'bytes string' assert column.escape(value) == "'bytes string'"
def test_int(self): column = Column('id', int) assert column.escape('22') == 22
def test_casts_datetime(self): value = datetime(2016, 1, 1, 0, 0, 0) column = Column('name', datetime) assert column.escape(value) == "'{}'".format(str(value))