Ticket #12948: 12948.diff

File 12948.diff, 804 bytes (added by coleifer, 15 years ago)
  • tests/modeltests/aggregation/models.py

    diff --git a/tests/modeltests/aggregation/models.py b/tests/modeltests/aggregation/models.py
    index 0e8d881..e5f0f5d 100644
    a b True  
    362362>>> Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values_list('mean_age', flat=True)
    363363[34.5]
    364364
    365 >>> Book.objects.values_list('price').annotate(count=Count('price')).order_by('-count', 'price')
    366 [(Decimal('29.69'), 2), (Decimal('23.09'), 1), (Decimal('30'), 1), (Decimal('75'), 1), (Decimal('82.8'), 1)]
     365>>> qs = Book.objects.values_list('price').annotate(count=Count('price')).order_by('-count', 'price')
     366>>> list(qs) == [(Decimal('29.69'), 2), (Decimal('23.09'), 1), (Decimal('30'), 1), (Decimal('75'), 1), (Decimal('82.8'), 1)]
     367True
    367368
    368369"""}
Back to Top