summaryrefslogtreecommitdiff
path: root/tests/select_related_regress
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2025-07-22 20:41:41 -0700
committernessita <124304+nessita@users.noreply.github.com>2025-07-23 20:17:55 -0300
commit69a93a88edb56ba47f624dac7a21aacc47ea474f (patch)
treef57507a4435d032493cae40e06ecb254790b67b2 /tests/select_related_regress
parent55b0cc21310b76ce4018dd793ba50556eaf0af06 (diff)
Refs #36500 -- Rewrapped long docstrings and block comments via a script.
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
Diffstat (limited to 'tests/select_related_regress')
-rw-r--r--tests/select_related_regress/tests.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/select_related_regress/tests.py b/tests/select_related_regress/tests.py
index 94a15bde24..b271c5b48c 100644
--- a/tests/select_related_regress/tests.py
+++ b/tests/select_related_regress/tests.py
@@ -32,12 +32,12 @@ class SelectRelatedRegressTests(TestCase):
Regression test for bug #7110.
When using select_related(), we must query the
- Device and Building tables using two different aliases (each) in order to
- differentiate the start and end Connection fields. The net result is that
- both the "connections = ..." queries here should give the same results
- without pulling in more than the absolute minimum number of tables
- (history has shown that it's easy to make a mistake in the implementation
- and include some unnecessary bonus joins).
+ Device and Building tables using two different aliases (each) in order
+ to differentiate the start and end Connection fields. The net result is
+ that both the "connections = ..." queries here should give the same
+ results without pulling in more than the absolute minimum number of
+ tables (history has shown that it's easy to make a mistake in the
+ implementation and include some unnecessary bonus joins).
"""
b = Building.objects.create(name="101")
@@ -70,8 +70,9 @@ class SelectRelatedRegressTests(TestCase):
[(c1.id, "router/4", "switch/7"), (c2.id, "switch/7", "server/1")],
)
- # This final query should only have seven tables (port, device and building
- # twice each, plus connection once). Thus, 6 joins plus the FROM table.
+ # This final query should only have seven tables (port, device and
+ # building twice each, plus connection once). Thus, 6 joins plus the
+ # FROM table.
self.assertEqual(str(connections.query).count(" JOIN "), 6)
def test_regression_8106(self):
@@ -102,8 +103,8 @@ class SelectRelatedRegressTests(TestCase):
the first related model in the tests below
("state") is empty and we try to select the more remotely related
- state__country. The regression here was not skipping the empty column results
- for country before getting status.
+ state__country. The regression here was not skipping the empty column
+ results for country before getting status.
"""
Country.objects.create(name="Australia")