summaryrefslogtreecommitdiff
path: root/tests/aggregation_regress
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-04-07 22:04:45 -0400
committerTim Graham <timograham@gmail.com>2016-04-08 10:12:33 -0400
commit92053acbb9160862c3e743a99ed8ccff8d4f8fd6 (patch)
tree50e7fd28a650f0e2352cf94f92e5a66d28a81988 /tests/aggregation_regress
parentdf8d8d4292684d6ffa7474f1e201aed486f02b53 (diff)
downloaddjango-92053acbb9160862c3e743a99ed8ccff8d4f8fd6.tar.gz
Fixed E128 flake8 warnings in tests/.
Diffstat (limited to 'tests/aggregation_regress')
-rw-r--r--tests/aggregation_regress/tests.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py
index 6d6ca3480f..5f8f8a44fc 100644
--- a/tests/aggregation_regress/tests.py
+++ b/tests/aggregation_regress/tests.py
@@ -1238,19 +1238,27 @@ class AggregationTests(TestCase):
tests aggregations with generic reverse relations
"""
django_book = Book.objects.get(name='Practical Django Projects')
- ItemTag.objects.create(object_id=django_book.id, tag='intermediate',
- content_type=ContentType.objects.get_for_model(django_book))
- ItemTag.objects.create(object_id=django_book.id, tag='django',
- content_type=ContentType.objects.get_for_model(django_book))
+ ItemTag.objects.create(
+ object_id=django_book.id, tag='intermediate',
+ content_type=ContentType.objects.get_for_model(django_book),
+ )
+ ItemTag.objects.create(
+ object_id=django_book.id, tag='django',
+ content_type=ContentType.objects.get_for_model(django_book),
+ )
# Assign a tag to model with same PK as the book above. If the JOIN
# used in aggregation doesn't have content type as part of the
# condition the annotation will also count the 'hi mom' tag for b.
wmpk = WithManualPK.objects.create(id=django_book.pk)
- ItemTag.objects.create(object_id=wmpk.id, tag='hi mom',
- content_type=ContentType.objects.get_for_model(wmpk))
+ ItemTag.objects.create(
+ object_id=wmpk.id, tag='hi mom',
+ content_type=ContentType.objects.get_for_model(wmpk),
+ )
ai_book = Book.objects.get(name__startswith='Paradigms of Artificial Intelligence')
- ItemTag.objects.create(object_id=ai_book.id, tag='intermediate',
- content_type=ContentType.objects.get_for_model(ai_book))
+ ItemTag.objects.create(
+ object_id=ai_book.id, tag='intermediate',
+ content_type=ContentType.objects.get_for_model(ai_book),
+ )
self.assertEqual(Book.objects.aggregate(Count('tags')), {'tags__count': 3})
results = Book.objects.annotate(Count('tags')).order_by('-tags__count', 'name')