diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-03 11:20:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-03 11:20:46 +0100 |
commit | c5cd8783825b5f6384417dac5f3889b4210b7d08 (patch) | |
tree | 3d4689aaa0e209e40d2d8df09edad7e155960b45 /tests/prefetch_related | |
parent | c9d6e3595cfd0aa58cde1656bd735ecfcd7a872b (diff) | |
download | django-c5cd8783825b5f6384417dac5f3889b4210b7d08.tar.gz |
Refs #33476 -- Refactored problematic code before reformatting by Black.
In these cases Black produces unexpected results, e.g.
def make_random_password(
self,
length=10,
allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789',
):
or
cursor.execute("""
SELECT ...
""",
[table name],
)
Diffstat (limited to 'tests/prefetch_related')
-rw-r--r-- | tests/prefetch_related/tests.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/prefetch_related/tests.py b/tests/prefetch_related/tests.py index 18f5de746f..b6de765391 100644 --- a/tests/prefetch_related/tests.py +++ b/tests/prefetch_related/tests.py @@ -1352,9 +1352,10 @@ class MultiDbTests(TestCase): books = "".join("%s (%s)\n" % (b.title, ", ".join(a.name for a in b.first_time_authors.all())) for b in B.prefetch_related('first_time_authors')) - self.assertEqual(books, - "Poems (Charlotte Bronte)\n" - "Sense and Sensibility (Jane Austen)\n") + self.assertEqual( + books, + "Poems (Charlotte Bronte)\nSense and Sensibility (Jane Austen)\n", + ) def test_using_is_honored_inheritance(self): B = BookWithYear.objects.using('other') @@ -1391,19 +1392,20 @@ class MultiDbTests(TestCase): books = "".join("%s (%s)\n" % (b.title, ", ".join(a.name for a in b.first_time_authors.all())) for b in B.prefetch_related(prefetch)) - self.assertEqual(books, - "Poems (Charlotte Bronte)\n" - "Sense and Sensibility (Jane Austen)\n") - + self.assertEqual( + books, + "Poems (Charlotte Bronte)\nSense and Sensibility (Jane Austen)\n", + ) # Explicit using on the same db. with self.assertNumQueries(2, using='other'): prefetch = Prefetch('first_time_authors', queryset=Author.objects.using('other')) books = "".join("%s (%s)\n" % (b.title, ", ".join(a.name for a in b.first_time_authors.all())) for b in B.prefetch_related(prefetch)) - self.assertEqual(books, - "Poems (Charlotte Bronte)\n" - "Sense and Sensibility (Jane Austen)\n") + self.assertEqual( + books, + "Poems (Charlotte Bronte)\nSense and Sensibility (Jane Austen)\n", + ) # Explicit using on a different db. with self.assertNumQueries(1, using='default'), self.assertNumQueries(1, using='other'): |