mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Removed redundant QuerySet.all() calls in docs and tests.
Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
This commit is contained in:
@@ -28,13 +28,13 @@ class Tests(TestCase):
|
||||
"""Raise NotSupportedError when aggregating on date/time fields."""
|
||||
for aggregate in (Sum, Avg, Variance, StdDev):
|
||||
with self.assertRaises(NotSupportedError):
|
||||
Item.objects.all().aggregate(aggregate("time"))
|
||||
Item.objects.aggregate(aggregate("time"))
|
||||
with self.assertRaises(NotSupportedError):
|
||||
Item.objects.all().aggregate(aggregate("date"))
|
||||
Item.objects.aggregate(aggregate("date"))
|
||||
with self.assertRaises(NotSupportedError):
|
||||
Item.objects.all().aggregate(aggregate("last_modified"))
|
||||
Item.objects.aggregate(aggregate("last_modified"))
|
||||
with self.assertRaises(NotSupportedError):
|
||||
Item.objects.all().aggregate(
|
||||
Item.objects.aggregate(
|
||||
**{
|
||||
"complex": aggregate("last_modified")
|
||||
+ aggregate("last_modified")
|
||||
|
||||
Reference in New Issue
Block a user