summaryrefslogtreecommitdiff
path: root/tests/aggregation_regress/tests.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-10-11 07:25:14 -0400
committerTim Graham <timograham@gmail.com>2013-10-11 07:25:14 -0400
commitb67ab75e82ec59dd4eeca119eeaf570d7c88556c (patch)
tree45bb072d08b4d7de7e6b76bf01fcd9bddcb43acd /tests/aggregation_regress/tests.py
parent695bc0d191c126a948a7cf3acc3e37d9377ebd20 (diff)
Fixed assorted flake8 errors.
Diffstat (limited to 'tests/aggregation_regress/tests.py')
-rw-r--r--tests/aggregation_regress/tests.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py
index 9fcaefe6f5..111ef79b5e 100644
--- a/tests/aggregation_regress/tests.py
+++ b/tests/aggregation_regress/tests.py
@@ -1017,20 +1017,20 @@ class AggregationTests(TestCase):
tests aggregations with generic reverse relations
"""
- b = Book.objects.get(name='Practical Django Projects')
- ItemTag.objects.create(object_id=b.id, tag='intermediate',
- content_type=ContentType.objects.get_for_model(b))
- ItemTag.objects.create(object_id=b.id, tag='django',
- content_type=ContentType.objects.get_for_model(b))
+ 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))
# 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=b.pk)
+ 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))
- b = Book.objects.get(name__startswith='Paradigms of Artificial Intelligence')
- ItemTag.objects.create(object_id=b.id, tag='intermediate',
- content_type=ContentType.objects.get_for_model(b))
+ 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))
self.assertEqual(Book.objects.aggregate(Count('tags')), {'tags__count': 3})
results = Book.objects.annotate(Count('tags')).order_by('-tags__count', 'name')