def test_adapted_sql(self):
"""
Check that the value is serialised to the correct SQL string, including
a type cast
"""
value = SimpleType(a=1, b="b", c=datetime.datetime(1985, 10, 26, 9, 0))
adapted = adapt(value)
adapted.prepare(connection.connection)
self.assertEqual(
b"(1, 'b', '1985-10-26T09:00:00'::timestamp)::test_type",
adapted.getquoted())
test_field.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录