mirror of
https://github.com/django/django.git
synced 2025-08-10 05:48:15 +00:00
Refs #24121 -- Added __repr__() to BaseDatabaseWrapper, JoinPromoter, and SQLCompiler.
This commit is contained in:
parent
5e218cc0b7
commit
6fa2930573
6 changed files with 52 additions and 1 deletions
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'>"
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue