mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #34111 -- Made test runner with --debug-sql format SQL queries.
This commit is contained in:
committed by
Mariusz Felisiak
parent
5ec64fa481
commit
3283120cca
@@ -17,6 +17,8 @@ from contextlib import contextmanager
|
||||
from importlib import import_module
|
||||
from io import StringIO
|
||||
|
||||
import sqlparse
|
||||
|
||||
import django
|
||||
from django.core.management import call_command
|
||||
from django.db import connections
|
||||
@@ -95,7 +97,9 @@ class DebugSQLTextTestResult(unittest.TextTestResult):
|
||||
self.stream.writeln(self.separator2)
|
||||
self.stream.writeln(err)
|
||||
self.stream.writeln(self.separator2)
|
||||
self.stream.writeln(sql_debug)
|
||||
self.stream.writeln(
|
||||
sqlparse.format(sql_debug, reindent=True, keyword_case="upper")
|
||||
)
|
||||
|
||||
|
||||
class PDBDebugResult(unittest.TextTestResult):
|
||||
|
||||
Reference in New Issue
Block a user