diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-12-21 11:41:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-21 11:41:29 +0100 |
| commit | 3b24a3fa337bedc11352a17952cb9c3f77f9b9f2 (patch) | |
| tree | 07ee0d4d39c6c2966a5cfc9aaec44b8abed3c153 | |
| parent | 2d676ee119696250a8b76c69ec9d9b799ddeb6b4 (diff) | |
Removed unnecessary commas in tests.
| -rw-r--r-- | tests/aggregation/test_filter_argument.py | 2 | ||||
| -rw-r--r-- | tests/aggregation/tests.py | 2 | ||||
| -rw-r--r-- | tests/lookup/tests.py | 2 | ||||
| -rw-r--r-- | tests/prefetch_related/tests.py | 4 | ||||
| -rw-r--r-- | tests/queries/tests.py | 4 | ||||
| -rw-r--r-- | tests/select_for_update/tests.py | 4 |
6 files changed, 8 insertions, 10 deletions
diff --git a/tests/aggregation/test_filter_argument.py b/tests/aggregation/test_filter_argument.py index 3ef0401d4d..75835edb0b 100644 --- a/tests/aggregation/test_filter_argument.py +++ b/tests/aggregation/test_filter_argument.py @@ -139,7 +139,7 @@ class FilteredAggregateTests(TestCase): self.assertEqual(qs.get(pk__in=qs.values("pk")), self.a1) def test_filtered_aggregate_ref_annotation(self): - aggs = Author.objects.annotate(double_age=F("age") * 2,).aggregate( + aggs = Author.objects.annotate(double_age=F("age") * 2).aggregate( cnt=Count("pk", filter=Q(double_age__gt=100)), ) self.assertEqual(aggs["cnt"], 2) diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index 4e860a7aa3..67a57c162c 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -2088,7 +2088,7 @@ class AggregateTestCase(TestCase): def test_aggregation_over_annotation_shared_alias(self): self.assertEqual( - Publisher.objects.annotate(agg=Count("book__authors"),).aggregate( + Publisher.objects.annotate(agg=Count("book__authors")).aggregate( agg=Count("agg"), ), {"agg": 5}, diff --git a/tests/lookup/tests.py b/tests/lookup/tests.py index 10e4c3d1fe..53eb76d174 100644 --- a/tests/lookup/tests.py +++ b/tests/lookup/tests.py @@ -1218,7 +1218,7 @@ class LookupTests(TestCase): def test_exact_exists(self): qs = Article.objects.filter(pk=OuterRef("pk")) - seasons = Season.objects.annotate(pk_exists=Exists(qs),).filter( + seasons = Season.objects.annotate(pk_exists=Exists(qs)).filter( pk_exists=Exists(qs), ) self.assertCountEqual(seasons, Season.objects.all()) diff --git a/tests/prefetch_related/tests.py b/tests/prefetch_related/tests.py index 4faf13bcaf..c153c0d9ec 100644 --- a/tests/prefetch_related/tests.py +++ b/tests/prefetch_related/tests.py @@ -1731,7 +1731,7 @@ class DirectPrefetchedObjectCacheReuseTests(TestCase): lookup. """ with self.assertNumQueries(3): - books = Book.objects.filter(title__in=["book1", "book2"],).prefetch_related( + books = Book.objects.filter(title__in=["book1", "book2"]).prefetch_related( Prefetch( "first_time_authors", Author.objects.prefetch_related( @@ -1785,7 +1785,7 @@ class DirectPrefetchedObjectCacheReuseTests(TestCase): def test_detect_is_fetched_with_to_attr(self): with self.assertNumQueries(3): - books = Book.objects.filter(title__in=["book1", "book2"],).prefetch_related( + books = Book.objects.filter(title__in=["book1", "book2"]).prefetch_related( Prefetch( "first_time_authors", Author.objects.prefetch_related( diff --git a/tests/queries/tests.py b/tests/queries/tests.py index 332a6e5d9a..a6a2b252eb 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -3322,9 +3322,7 @@ class ExcludeTests(TestCase): ) self.assertCountEqual( Job.objects.annotate( - responsibility=subquery.filter(job=OuterRef("name"),).values( - "id" - )[:1] + responsibility=subquery.filter(job=OuterRef("name")).values("id")[:1] ), [self.j1, self.j2], ) diff --git a/tests/select_for_update/tests.py b/tests/select_for_update/tests.py index 5f5ada8939..97c067d76e 100644 --- a/tests/select_for_update/tests.py +++ b/tests/select_for_update/tests.py @@ -243,7 +243,7 @@ class SelectForUpdateTests(TransactionTestCase): def test_for_update_sql_model_proxy_generated_of(self): with transaction.atomic(), CaptureQueriesContext(connection) as ctx: list( - CityCountryProxy.objects.select_related("country",).select_for_update( + CityCountryProxy.objects.select_related("country").select_for_update( of=("country",), ) ) @@ -422,7 +422,7 @@ class SelectForUpdateTests(TransactionTestCase): with self.subTest(name=name): with self.assertRaisesMessage(FieldError, msg % name): with transaction.atomic(): - Person.objects.select_related("born", "profile",).exclude( + Person.objects.select_related("born", "profile").exclude( profile=None ).select_for_update(of=(name,)).get() |
