mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #24121 -- Added __repr__() to BaseDatabaseWrapper, JoinPromoter, and SQLCompiler.
This commit is contained in:
committed by
Mariusz Felisiak
parent
5e218cc0b7
commit
6fa2930573
17
tests/queries/test_sqlcompiler.py
Normal file
17
tests/queries/test_sqlcompiler.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from django.db import DEFAULT_DB_ALIAS, connection
|
||||
from django.db.models.sql import Query
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
from .models import Item
|
||||
|
||||
|
||||
class SQLCompilerTest(SimpleTestCase):
|
||||
def test_repr(self):
|
||||
query = Query(Item)
|
||||
compiler = query.get_compiler(DEFAULT_DB_ALIAS, connection)
|
||||
self.assertEqual(
|
||||
repr(compiler),
|
||||
f"<SQLCompiler model=Item connection="
|
||||
f"<DatabaseWrapper vendor={connection.vendor!r} alias='default'> "
|
||||
f"using='default'>"
|
||||
)
|
||||
Reference in New Issue
Block a user