From d55a1e5809b424907528af42bfdfc2991ef11651 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 3 Feb 2022 11:20:46 +0100 Subject: [4.0.x] 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], ) Backport of c5cd8783825b5f6384417dac5f3889b4210b7d08 from main. --- tests/annotations/tests.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'tests/annotations') diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py index 62912ee99c..37ca569389 100644 --- a/tests/annotations/tests.py +++ b/tests/annotations/tests.py @@ -967,8 +967,7 @@ class AliasTests(TestCase): def test_aggregate_alias(self): msg = ( - "Cannot aggregate over the 'other_age' alias. Use annotate() to " - "promote it." + "Cannot aggregate over the 'other_age' alias. Use annotate() to promote it." ) with self.assertRaisesMessage(FieldError, msg): Author.objects.alias( @@ -992,10 +991,7 @@ class AliasTests(TestCase): def test_values_alias(self): qs = Book.objects.alias(rating_alias=F('rating') - 1) - msg = ( - "Cannot select the 'rating_alias' alias. Use annotate() to " - "promote it." - ) + msg = "Cannot select the 'rating_alias' alias. Use annotate() to promote it." for operation in ['values', 'values_list']: with self.subTest(operation=operation): with self.assertRaisesMessage(FieldError, msg): -- cgit v1.3