1
0
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:
Jonny Park
2021-03-26 16:14:09 +09:00
committed by Mariusz Felisiak
parent 5e218cc0b7
commit 6fa2930573
6 changed files with 52 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ from django.db.models.expressions import Col, Func
from django.db.models.fields.related_lookups import RelatedIsNull
from django.db.models.functions import Lower
from django.db.models.lookups import Exact, GreaterThan, IsNull, LessThan
from django.db.models.sql.query import Query
from django.db.models.sql.query import JoinPromoter, Query
from django.db.models.sql.where import OR
from django.test import SimpleTestCase
from django.test.utils import register_lookup
@@ -150,3 +150,11 @@ class TestQuery(SimpleTestCase):
msg = 'Cannot filter against a non-conditional expression.'
with self.assertRaisesMessage(TypeError, msg):
query.build_where(Func(output_field=CharField()))
class JoinPromoterTest(SimpleTestCase):
def test_repr(self):
self.assertEqual(
repr(JoinPromoter('AND', 3, True)),
"JoinPromoter(connector='AND', num_children=3, negated=True)",
)