def tabularasa(self):
"""Truncate all tables.
Used for testing to truncate all tables so the database is clean.
"""
table_names = [
'tasks',
'result_message',
'active_instance',
'boot_action',
'boot_action_status',
]
conn = self.db_engine.connect()
for t in table_names:
query_text = sql.text(
"TRUNCATE TABLE %s" % t).execution_options(autocommit=True)
conn.execute(query_text)
conn.close()
评论列表
文章目录