def test_sqlformatter(self):
sqlformatter = SqlFormatter().format(self.model)
sql_compare = 'SELECT "django_migrations"."app","django_migrations"."name" FROM "django_migrations"'
sql_compare = sqlparse.format(sql_compare, reindent=True, keyword_case='upper')
sql_compare = "(0.005ms) {0}".format(sql_compare)
sql_compare = highlight(
sql_compare,
SqlLexer(),
Terminal256Formatter(style='default')
)
self.assertEqual(sql_compare, sqlformatter)
评论列表
文章目录