adv_test_base_db_ext.py 文件源码

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

项目:djaio 作者: Sberned 项目源码 文件源码
def test_base_db_ext_valid_and_wrong_inserts(self):
        await self.init_db()
        with pytest.raises(psycopg2.ProgrammingError):
            await self.app.db.execute(db_name='test_db', query="""
                    INSERT INTO test_table(name) VALUES ('djaio_boo');
                    INSERT INTO test_table(name1) VALUES ('djaio');
            """, values=[], _type='select')
        bad_val = await self.app.db.execute('test_db', "select * from test_table  where name='djaio_boo';", [], 'select')
        assert bad_val == []
        assert True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号