test_results.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:QXSConsolas 作者: qxsch 项目源码 文件源码
def test_row_w_scalar_select(self):
        """test that a scalar select as a column is returned as such
        and that type conversion works OK.

        (this is half a SQLAlchemy Core test and half to catch database
        backends that may have unusual behavior with scalar selects.)

        """
        datetable = self.tables.has_dates
        s = select([datetable.alias('x').c.today]).as_scalar()
        s2 = select([datetable.c.id, s.label('somelabel')])
        row = config.db.execute(s2).first()

        eq_(row['somelabel'], datetime.datetime(2006, 5, 12, 12, 0, 0))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号